{"version":3,"sources":["jsdelivr-header.js","/npm/@findify/sdk@2.5.14/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,UAAW,eACT,WAAc,qBACX,MAAO,sBACP,aAAc,oBACjB,mBAAsB,sBACtB,wBAA2B,iBACpC,MAAM,UAAY,CAAC,cAAe,UAAW,cAEvC,WAAa,aAEb,WAAa,MACf,IACI,OAAO,QAAQ,IAAI,WACvB,CACA,MACI,OAAO,UACX,CACH,EAPkB,GAQb,IAAM,YAAc,WAC1B,IAAK,UAAU,SAAS,KACpB,MAAM,IAAI,MAAM,GAAG,oCAGvB,MAAM,SAAW,SAAS,YAOnB,SAAS,KAAK,GACjB,MAAM,EAAiC,oBAAX,OAC5B,MAAM,MAAN,CAAa,QAAS,KACtB,MAAM,MAAN,CAAa,aAAc,UAC3B,MAAM,MAAN,CAAa,iBAAkB,GAC/B,MAAM,EAAM,YAAY,EAAQ,GAEhC,OADA,eAAe,EAAK,GACb,IAAI,OAAO,EACtB,CACA,MAAM,YAAc,CAAC,EAAK,KAAiB,CACvC,OAAQ,EAAe,EAAE,OAAO,MAAQ,EAAE,OAAO,QAC9C,YACA","file":"/npm/@findify/sdk@2.5.14/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@findify/sdk@2.5.14/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import debug from 'debug';\nimport { Client } from './client';\nimport * as R from './request';\nimport * as settings from './settings';\nimport { validateConfig } from './validation';\nexport { Type as RequestType } from './request/Type';\nconst knownEnvs = ['development', 'staging', 'production'];\n/** Default environment that would be used if nothing is set. */\nconst defaultEnv = 'production';\n/** Current environment specified in `process.env.FINDIFY_ENV`. */\nconst findifyEnv = (() => {\n    try {\n        return process.env.FINDIFY_ENV;\n    }\n    catch {\n        return defaultEnv;\n    }\n})();\nconst env = findifyEnv || defaultEnv;\nif (!knownEnvs.includes(env)) {\n    throw new Error(`${env} is not supported environment`);\n}\n/** Environment-dependent default settings */\nconst defaults = settings[env];\n/**\n * Initializes the SDK.\n * @param config SDK configuration options.\n * @returns Client instance, which could be used further\n * for sending requests to the server.\n */\nexport function init(config) {\n    const isBrowserEnv = typeof window !== 'undefined';\n    debug('sdk')('env: ', env);\n    debug('sdk')('defaults: ', defaults);\n    debug('sdk')('isBrowserEnv: ', isBrowserEnv);\n    const cfg = setDefaults(config, isBrowserEnv);\n    validateConfig(cfg, isBrowserEnv);\n    return new Client(cfg);\n}\nconst setDefaults = (cfg, isBrowserEnv) => ({\n    method: isBrowserEnv ? R.Method.JSONP : R.Method.POST,\n    ...defaults,\n    ...cfg,\n});\n"]}