{"version":3,"sources":["jsdelivr-header.js","/npm/which-browser@0.7.1/src/Parser.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,KAAO,QAAQ,gBACf,SAAW,QAAQ,cACnB,MAAQ,QAAQ,WAKtB,MAAM,eAAe,KASnB,WAAA,CAAY,EAAU,KAAM,EAAU,CAAC,GACrC,QAEI,GACF,KAAK,QAAQ,EAAS,EAE1B,CAQA,OAAA,CAAQ,EAAS,EAAU,CAAC,GAC1B,IACI,EAWA,EAZA,EAAI,EAaR,GAXuB,iBAAZ,EACT,EAAI,CAAE,aAAc,GACX,EAAiB,SAC1B,EAAI,EAAiB,QAErB,EAAiB,QAAI,KACrB,EAAI,OAAO,OAAO,CAAC,EAAG,EAAS,IAE/B,EAAI,EAGD,EAAO,MAAM,iBAAiB,EAAG,EAAG,MAKvC,YAJoB,iBAAT,IACT,OAAO,OAAO,KAAM,GACpB,KAAK,QAAS,IAKlB,MAAM,EAAW,IAAI,SAAS,EAAG,GACjC,EAAS,QAAQ,MACjB,EAAS,SACX,EAEF,OAAO,aAAe,SACtB,OAAO,QAAU","file":"/npm/which-browser@0.7.1/src/Parser.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/which-browser@0.7.1/src/Parser.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const Main = require('./model/Main');\nconst Analyser = require('./Analyser');\nconst Cache = require('./Cache');\n\n/**\n * Class that parse the user-agent\n */\nclass Parser extends Main {\n  /**\n   * Create a new object that contains all the detected information\n   *\n   * @param  {object|string}   headers   Optional, an object with all of the headers or a string with just the User-Agent header\n   * @param  {object}          options   Optional, an object with configuration options\n   * @param  {int}             [options.cacheExpires=900]   Expiry time in seconds\n   * @param  {int}             [options.cacheCheckInterval=1/5 * options.cacheExpires] Time in seconds between each cache check to remove expired records. Minimum 1\n   */\n  constructor(headers = null, options = {}) {\n    super();\n\n    if (headers) {\n      this.analyse(headers, options);\n    }\n  }\n\n  /**\n   * Analyse the provided headers or User-Agent string\n   *\n   * @param  {object|string}   headers   An object with all of the headers or a string with just the User-Agent header\n   * @param  {object}         options   Optional, an object with configuration options\n   */\n  analyse(headers, options = {}) {\n    let o = options;\n    let h;\n    if (typeof headers === 'string') {\n      h = { 'User-Agent': headers };\n    } else if (headers['headers']) {\n      h = headers['headers'];\n\n      headers['headers'] = null;\n      o = Object.assign({}, headers, options);\n    } else {\n      h = headers;\n    }\n    let data;\n    if ((data = Cache.analyseWithCache(h, o, this))) {\n      if (typeof data === 'object') {\n        Object.assign(this, data);\n        this.cached = true;\n      }\n      return;\n    }\n\n    const analyser = new Analyser(h, o);\n    analyser.setData(this);\n    analyser.analyse();\n  }\n}\nParser.SIMPLE_CACHE = 'simple';\nmodule.exports = Parser;\n"]}