From 498e4973bd7630129161c65ea3cab5afca4749f3 Mon Sep 17 00:00:00 2001 From: Jason Waters Date: Mon, 13 Sep 2021 17:03:33 -0600 Subject: [PATCH 1/7] updated react spa demo --- react-shopping-cart-demo/config.json | 7 +- react-shopping-cart-demo/index.tpl | 4 +- react-shopping-cart-demo/package-lock.json | 9916 ++++++++++++- react-shopping-cart-demo/package.json | 5 +- .../public/AppMeasurement.js | 8 +- .../public/assets/js/app.js | 2 +- .../assets/resources/data/latestProducts.json | 35 +- .../assets/resources/data/products.json | 99 +- react-shopping-cart-demo/public/at-odd.js | 11449 ++++++++++++++++ react-shopping-cart-demo/public/at.js | 2 - react-shopping-cart-demo/server.js | 50 +- 11 files changed, 21270 insertions(+), 307 deletions(-) create mode 100644 react-shopping-cart-demo/public/at-odd.js delete mode 100644 react-shopping-cart-demo/public/at.js diff --git a/react-shopping-cart-demo/config.json b/react-shopping-cart-demo/config.json index d4e3938..db3ec54 100644 --- a/react-shopping-cart-demo/config.json +++ b/react-shopping-cart-demo/config.json @@ -1,6 +1,7 @@ { - "client": "adobetargetmobile", - "organizationId": "B8A054D958807F770A495DD6@AdobeOrg", + "client": "targetdataplatform", + "organizationId": "6FC947105BB267B70A495EE9@AdobeOrg", + "edgeConfigId": "34610d20-3c46-4636-b22f-eb87110dfb25:dev", "timeout": 10000, - "serverDomain": "adobetargetmobile.tt.omtrdc.net" + "serverDomain": "targetdataplatform.tt.omtrdc.net" } diff --git a/react-shopping-cart-demo/index.tpl b/react-shopping-cart-demo/index.tpl index e0635b0..6a4dcda 100644 --- a/react-shopping-cart-demo/index.tpl +++ b/react-shopping-cart-demo/index.tpl @@ -22,10 +22,12 @@ clientCode: "${clientCode}", imsOrgId: "${organizationId}", serverDomain: "${serverDomain}", + pageLoadEnabled: false, + viewsEnabled: true, serverState: ${serverState} || {} } - +
diff --git a/react-shopping-cart-demo/package-lock.json b/react-shopping-cart-demo/package-lock.json index 1ea5e00..62a059a 100644 --- a/react-shopping-cart-demo/package-lock.json +++ b/react-shopping-cart-demo/package-lock.json @@ -1,8 +1,9569 @@ { "name": "target-nodejs-react-sample", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "target-nodejs-react-sample", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "@adobe/target-nodejs-sdk": "^2.1.0", + "axios": "^0.19.0", + "cookie-parser": "^1.4.4", + "express": "^4.16.4", + "prettier": "^2.4.0", + "react": "^16.8.1", + "react-dom": "^16.8.1", + "react-redux": "^6.0.0", + "react-router": "^4.3.1", + "react-router-dom": "^4.3.1", + "react-router-redux": "^4.0.8", + "react-slick": "^0.23.2", + "redux": "^3.7.2", + "redux-thunk": "^2.3.0" + }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.5", + "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.18.0", + "babel-preset-react": "^6.24.1", + "copy-webpack-plugin": "^4.6.0", + "file-loader": "^3.0.1", + "randomstring": "^1.1.5", + "react-helmet": "^5.2.0", + "uglifyjs-webpack-plugin": "^2.1.1", + "url-loader": "^1.1.2", + "webpack": "^4.29.5", + "webpack-cli": "^3.2.3" + } + }, + "node_modules/@adobe-mcid/visitor-js-server": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@adobe-mcid/visitor-js-server/-/visitor-js-server-2.0.0.tgz", + "integrity": "sha512-z9t4L2F/5GPdaEQN5GR0Bj4j21T5iqvXqpKXg2NGD9Vo/1sw5xM0S55skhDAMDjJ1Q7xxkCW994cWTG2kXTqYA==", + "dependencies": { + "@adobe-mcid/visitor-js-shared": "~0.0.1" + } + }, + "node_modules/@adobe-mcid/visitor-js-shared": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@adobe-mcid/visitor-js-shared/-/visitor-js-shared-0.0.7.tgz", + "integrity": "sha1-SDrwi+GrSwv2s0hYpI1Uc9sIfVQ=" + }, + "node_modules/@adobe/target-nodejs-sdk": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@adobe/target-nodejs-sdk/-/target-nodejs-sdk-2.2.1.tgz", + "integrity": "sha512-PWw9JSDN/QOyYwB0myscnkzKawq8/49JETQFI2a5Fvg6szPYuaELrFgW3BIMF4Ng/GwLmxhbI7J1+WoyvTpFCQ==", + "dependencies": { + "@adobe-mcid/visitor-js-server": "^2.0.0", + "fast-text-encoding": "^1.0.3", + "form-data": "^3.0.0", + "http-status-codes": "^1.4.0", + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.0.0" + }, + "engines": { + "node": ">=8.16.0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.3.tgz", + "integrity": "sha512-kq6anf9JGjW8Nt5rYfEuGRaEAaH1mkv3Bbu6rYvLOpPh/RusSJXuKPEAoZ7L7gybZkchE8+NV5g9vKF4AGAtsA==", + "dependencies": { + "regenerator-runtime": "^0.13.2" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", + "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", + "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", + "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", + "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-code-frame": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", + "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "node_modules/@webassemblyjs/helper-fsm": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", + "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-module-context": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", + "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "mamacro": "^0.0.3" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", + "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", + "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", + "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", + "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", + "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", + "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/helper-wasm-section": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-opt": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", + "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", + "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", + "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "node_modules/@webassemblyjs/wast-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", + "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/floating-point-hex-parser": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-code-frame": "1.8.5", + "@webassemblyjs/helper-fsm": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", + "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "node_modules/ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true, + "peerDependencies": { + "ajv": ">=5.0.0" + } + }, + "node_modules/ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "optional": true, + "dependencies": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "optional": true, + "dependencies": { + "arr-flatten": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" + }, + "node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "dependencies": { + "object-assign": "^4.1.1", + "util": "0.10.3" + } + }, + "node_modules/assert/node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "node_modules/assert/node_modules/util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "dependencies": { + "inherits": "2.0.1" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/axios": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", + "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==", + "deprecated": "Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410", + "dependencies": { + "follow-redirects": "1.5.10", + "is-buffer": "^2.0.2" + } + }, + "node_modules/babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "dev": true, + "dependencies": { + "babel-core": "^6.26.0", + "babel-polyfill": "^6.26.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "commander": "^2.11.0", + "convert-source-map": "^1.5.0", + "fs-readdir-recursive": "^1.0.0", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "output-file-sync": "^1.1.2", + "path-is-absolute": "^1.0.1", + "slash": "^1.0.0", + "source-map": "^0.5.6", + "v8flags": "^2.1.1" + }, + "bin": { + "babel": "bin/babel.js", + "babel-doctor": "bin/babel-doctor.js", + "babel-external-helpers": "bin/babel-external-helpers.js", + "babel-node": "bin/babel-node.js" + }, + "optionalDependencies": { + "chokidar": "^1.6.1" + } + }, + "node_modules/babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "node_modules/babel-code-frame/node_modules/js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "node_modules/babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "dev": true, + "dependencies": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + }, + "node_modules/babel-core/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "dev": true, + "dependencies": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "node_modules/babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "dependencies": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-builder-react-jsx": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", + "integrity": "sha1-Of+DE7dci2Xc7/HzHTg+D/KkCKA=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "esutils": "^2.0.2" + } + }, + "node_modules/babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "dependencies": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "dependencies": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "dependencies": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-loader": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.5.tgz", + "integrity": "sha512-iCHfbieL5d1LfOQeeVJEUyD9rTwBcP/fcEbRCfempxTDuqrKpu0AZjLAQHEQa3Yqyj9ORKe2iHfoj4rHLf7xpw==", + "dev": true, + "dependencies": { + "find-cache-dir": "^1.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "babel-core": "6", + "webpack": "2 || 3 || 4" + } + }, + "node_modules/babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "node_modules/babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "node_modules/babel-plugin-syntax-flow": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-flow/-/babel-plugin-syntax-flow-6.18.0.tgz", + "integrity": "sha1-TDqyCiryaqIM0lmVw5jE63AxDI0=", + "dev": true + }, + "node_modules/babel-plugin-syntax-jsx": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", + "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", + "dev": true + }, + "node_modules/babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "node_modules/babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "dependencies": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "dependencies": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "dependencies": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "dependencies": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "dependencies": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "node_modules/babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "dependencies": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "dependencies": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "dependencies": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "dependencies": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "dependencies": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "dependencies": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "node_modules/babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "dependencies": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-flow-strip-types": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-strip-types/-/babel-plugin-transform-flow-strip-types-6.22.0.tgz", + "integrity": "sha1-hMtnKTXUNxT9wyvOhFaNh0Qc988=", + "dev": true, + "dependencies": { + "babel-plugin-syntax-flow": "^6.18.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-react-display-name": { + "version": "6.25.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-display-name/-/babel-plugin-transform-react-display-name-6.25.0.tgz", + "integrity": "sha1-Z+K/Hx6ck6sI25Z5LgU5K/LMKNE=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-react-jsx": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", + "integrity": "sha1-hAoCjn30YN/DotKfDA2R9jduZqM=", + "dev": true, + "dependencies": { + "babel-helper-builder-react-jsx": "^6.24.1", + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-react-jsx-self": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-self/-/babel-plugin-transform-react-jsx-self-6.22.0.tgz", + "integrity": "sha1-322AqdomEqEh5t3XVYvL7PBuY24=", + "dev": true, + "dependencies": { + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-react-jsx-source": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx-source/-/babel-plugin-transform-react-jsx-source-6.22.0.tgz", + "integrity": "sha1-ZqwSFT9c0tF7PBkmj0vwGX9E7NY=", + "dev": true, + "dependencies": { + "babel-plugin-syntax-jsx": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "node_modules/babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "dependencies": { + "regenerator-transform": "^0.10.0" + } + }, + "node_modules/babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "node_modules/babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + } + }, + "node_modules/babel-polyfill/node_modules/regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=", + "dev": true + }, + "node_modules/babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "dev": true, + "dependencies": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "node_modules/babel-preset-es2015": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "deprecated": "🙌 Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!", + "dev": true, + "dependencies": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", + "babel-plugin-transform-es2015-classes": "^6.24.1", + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", + "babel-plugin-transform-es2015-destructuring": "^6.22.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", + "babel-plugin-transform-es2015-for-of": "^6.22.0", + "babel-plugin-transform-es2015-function-name": "^6.24.1", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-transform-es2015-object-super": "^6.24.1", + "babel-plugin-transform-es2015-parameters": "^6.24.1", + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", + "babel-plugin-transform-regenerator": "^6.24.1" + } + }, + "node_modules/babel-preset-flow": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-preset-flow/-/babel-preset-flow-6.23.0.tgz", + "integrity": "sha1-5xIYiHCFrpoktb5Baa/7WZgWxJ0=", + "dev": true, + "dependencies": { + "babel-plugin-transform-flow-strip-types": "^6.22.0" + } + }, + "node_modules/babel-preset-react": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-react/-/babel-preset-react-6.24.1.tgz", + "integrity": "sha1-umnfrqRfw+xjm2pOzqbhdwLJE4A=", + "dev": true, + "dependencies": { + "babel-plugin-syntax-jsx": "^6.3.13", + "babel-plugin-transform-react-display-name": "^6.23.0", + "babel-plugin-transform-react-jsx": "^6.24.1", + "babel-plugin-transform-react-jsx-self": "^6.22.0", + "babel-plugin-transform-react-jsx-source": "^6.22.0", + "babel-preset-flow": "^6.23.0" + } + }, + "node_modules/babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "dev": true, + "dependencies": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + } + }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "node_modules/babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "dependencies": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "node_modules/babel-traverse/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "node_modules/babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true, + "bin": { + "babylon": "bin/babylon.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "dev": true + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.0.tgz", + "integrity": "sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg==", + "dev": true + }, + "node_modules/bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dependencies": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "optional": true, + "dependencies": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "dependencies": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "dev": true, + "dependencies": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + }, + "bin": { + "browserslist": "cli.js" + } + }, + "node_modules/buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "deprecated": "This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer", + "dev": true, + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "node_modules/buffer/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cache-base/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30000999", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000999.tgz", + "integrity": "sha512-1CUyKyecPeksKwXZvYw0tEoaMCo/RwBlXmEtN5vVnabvO0KPd9RQLcaAuR9/1F+KDMv6esmOFWlsXuzDk+8rxg==", + "dev": true + }, + "node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "optional": true, + "dependencies": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + }, + "optionalDependencies": { + "fsevents": "^1.0.0" + } + }, + "node_modules/chownr": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.3.tgz", + "integrity": "sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==", + "dev": true + }, + "node_modules/chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/classnames": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz", + "integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==" + }, + "node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz", + "integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "dependencies": { + "date-now": "^0.1.4" + } + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-parser": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.4.tgz", + "integrity": "sha512-lo13tqF3JEtFO7FyA49CqbhaFkskRJ0u/UAiINgrIXeRCY41c88/zxtrECl8AKH3B0hj9q10+h3Kt8I7KlW4tw==", + "dependencies": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + }, + "node_modules/copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "dependencies": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/copy-webpack-plugin": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.6.0.tgz", + "integrity": "sha512-Y+SQCF+0NoWQryez2zXn5J5knmr9z/9qSQt7fbL78u83rxmigOy8X5+BFn8CFSuX+nKT8gpYwJX68ekqtQt6ZA==", + "dev": true, + "dependencies": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "globby": "^7.1.1", + "is-glob": "^4.0.0", + "loader-utils": "^1.1.0", + "minimatch": "^3.0.4", + "p-limit": "^1.0.0", + "serialize-javascript": "^1.4.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/copy-webpack-plugin/node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/copy-webpack-plugin/node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-js": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", + "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==", + "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "node_modules/date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "node_modules/debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "dependencies": { + "repeating": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/dir-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz", + "integrity": "sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==", + "dev": true, + "dependencies": { + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true, + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "node_modules/electron-to-chromium": { + "version": "1.3.280", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.280.tgz", + "integrity": "sha512-qYWNMjKLEfQAWZF2Sarvo+ahigu0EArnpCFSoUuZJS3W5wIeVfeEvsgmT2mgIrieQkeQ0+xFmykK3nx2ezekPQ==", + "dev": true + }, + "node_modules/elliptic": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", + "integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", + "dev": true, + "dependencies": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.1.tgz", + "integrity": "sha512-98p2zE+rL7/g/DzMHMTF4zZlCgeVdJ7yr6xzEpJRYwFYrGi9ANdn5DnJURg6RpBkyk60XYDnWIv51VfIhfNGuA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/enhanced-resolve/node_modules/memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/enquire.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/enquire.js/-/enquire.js-2.1.6.tgz", + "integrity": "sha1-PoeAybi4NQhMP2DhZtvDwqPImBQ=" + }, + "node_modules/errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "dependencies": { + "estraverse": "^4.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "optional": true, + "dependencies": { + "is-posix-bracket": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "optional": true, + "dependencies": { + "fill-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend-shallow/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "optional": true, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "node_modules/fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, + "node_modules/figgy-pudding": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "dev": true + }, + "node_modules/file-loader": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-3.0.1.tgz", + "integrity": "sha512-4sNIOXgtH/9WZq4NvlfU3Opn5ynUsqBwSLyM+I7UOwdGigTBYfVVQEwe/msZNX/j4pCJTIM14Fsw66Svo1oVrw==", + "dev": true, + "dependencies": { + "loader-utils": "^1.0.2", + "schema-utils": "^1.0.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^4.0.0" + } + }, + "node_modules/filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/findup-sync/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/findup-sync/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "dependencies": { + "debug": "=3.1.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "optional": true, + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/form-data": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "node_modules/fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "bundleDependencies": [ + "node-pre-gyp" + ], + "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/fsevents/node_modules/abbrev": { + "version": "1.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/ansi-regex": { + "version": "2.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/aproba": { + "version": "1.2.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/are-we-there-yet": { + "version": "1.1.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/fsevents/node_modules/balanced-match": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/brace-expansion": { + "version": "1.1.11", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/fsevents/node_modules/chownr": { + "version": "1.1.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/code-point-at": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/concat-map": { + "version": "0.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/console-control-strings": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/core-util-is": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/debug": { + "version": "4.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/fsevents/node_modules/deep-extend": { + "version": "0.6.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/fsevents/node_modules/delegates": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/detect-libc": { + "version": "1.0.3", + "dev": true, + "inBundle": true, + "license": "Apache-2.0", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/fsevents/node_modules/fs-minipass": { + "version": "1.2.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^2.2.1" + } + }, + "node_modules/fsevents/node_modules/fs.realpath": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/gauge": { + "version": "2.7.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/fsevents/node_modules/glob": { + "version": "7.1.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/fsevents/node_modules/has-unicode": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/iconv-lite": { + "version": "0.4.24", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/ignore-walk": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "minimatch": "^3.0.4" + } + }, + "node_modules/fsevents/node_modules/inflight": { + "version": "1.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/fsevents/node_modules/inherits": { + "version": "2.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/ini": { + "version": "1.3.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/fsevents/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/isarray": { + "version": "1.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/minimatch": { + "version": "3.0.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/fsevents/node_modules/minimist": { + "version": "0.0.8", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/minipass": { + "version": "2.3.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "node_modules/fsevents/node_modules/minizlib": { + "version": "1.2.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^2.2.1" + } + }, + "node_modules/fsevents/node_modules/mkdirp": { + "version": "0.5.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "minimist": "0.0.8" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/fsevents/node_modules/ms": { + "version": "2.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/needle": { + "version": "2.3.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/fsevents/node_modules/node-pre-gyp": { + "version": "0.12.0", + "dev": true, + "inBundle": true, + "license": "BSD-3-Clause", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/fsevents/node_modules/nopt": { + "version": "4.0.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/fsevents/node_modules/npm-bundled": { + "version": "1.0.6", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/npm-packlist": { + "version": "1.4.1", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "node_modules/fsevents/node_modules/npmlog": { + "version": "4.1.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/fsevents/node_modules/number-is-nan": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/object-assign": { + "version": "4.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/once": { + "version": "1.4.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/fsevents/node_modules/os-homedir": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/os-tmpdir": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/osenv": { + "version": "0.1.5", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/fsevents/node_modules/path-is-absolute": { + "version": "1.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/process-nextick-args": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/rc": { + "version": "1.2.8", + "dev": true, + "inBundle": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/fsevents/node_modules/rc/node_modules/minimist": { + "version": "1.2.0", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/readable-stream": { + "version": "2.3.6", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/fsevents/node_modules/rimraf": { + "version": "2.6.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/fsevents/node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/safer-buffer": { + "version": "2.1.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/sax": { + "version": "1.2.4", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/semver": { + "version": "5.7.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/fsevents/node_modules/set-blocking": { + "version": "2.0.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/signal-exit": { + "version": "3.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/string_decoder": { + "version": "1.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/fsevents/node_modules/string-width": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/strip-ansi": { + "version": "3.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/strip-json-comments": { + "version": "2.0.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fsevents/node_modules/tar": { + "version": "4.4.8", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + }, + "engines": { + "node": ">=4.5" + } + }, + "node_modules/fsevents/node_modules/util-deprecate": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "MIT", + "optional": true + }, + "node_modules/fsevents/node_modules/wide-align": { + "version": "1.1.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/fsevents/node_modules/wrappy": { + "version": "1.0.2", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/fsevents/node_modules/yallist": { + "version": "3.0.3", + "dev": true, + "inBundle": true, + "license": "ISC", + "optional": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/get-stream/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "optional": true, + "dependencies": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "optional": true, + "dependencies": { + "is-glob": "^2.0.0" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-modules/node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-modules/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/globby": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", + "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", + "dev": true, + "dependencies": { + "array-union": "^1.0.1", + "dir-glob": "^2.0.0", + "glob": "^7.1.2", + "ignore": "^3.3.5", + "pify": "^3.0.0", + "slash": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", + "dev": true + }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-value/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/history": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz", + "integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==", + "dependencies": { + "@babel/runtime": "^7.1.2", + "loose-envify": "^1.2.0", + "resolve-pathname": "^3.0.0", + "tiny-invariant": "^1.0.2", + "tiny-warning": "^1.0.0", + "value-equal": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/hoist-non-react-statics": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz", + "integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==", + "dependencies": { + "react-is": "^16.7.0" + } + }, + "node_modules/home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "dev": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-status-codes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-1.4.0.tgz", + "integrity": "sha512-JrT3ua+WgH8zBD3HEJYbeEgnuQaAnUeRRko/YojPAJjGmIfGD3KPU/asLdsLwKjfxOmQe5nXMQ0pt/7MyapVbQ==" + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "node_modules/iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "node_modules/ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "node_modules/import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "dependencies": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "node_modules/ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "optional": true, + "dependencies": { + "is-primitive": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "optional": true, + "dependencies": { + "is-extglob": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isobject/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json2mq": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/json2mq/-/json2mq-0.2.0.tgz", + "integrity": "sha1-tje9O6nqvhIsg+lyBIOusQ0skEo=", + "dependencies": { + "string-convert": "^0.2.0" + } + }, + "node_modules/json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kind-of/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "dependencies": { + "invert-kv": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/loader-utils/node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/loader-utils/node_modules/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" + }, + "node_modules/lodash-es": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz", + "integrity": "sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==" + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "dependencies": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "node_modules/make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, + "node_modules/map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "dependencies": { + "p-defer": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true, + "optional": true + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "dependencies": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "optional": true, + "dependencies": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", + "dependencies": { + "mime-db": "1.40.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "node_modules/mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "dependencies": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-deep/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)", + "dev": true, + "dependencies": { + "minimist": "0.0.8" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "dependencies": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nanomatch/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node_modules/node-libs-browser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-visit/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "optional": true, + "dependencies": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "dependencies": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "node_modules/p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "dev": true + }, + "node_modules/parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "dependencies": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.5.tgz", + "integrity": "sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ==", + "dev": true, + "dependencies": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "optional": true, + "dependencies": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + }, + "node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "dependencies": { + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prettier": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz", + "integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "node_modules/prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", + "dependencies": { + "forwarded": "~0.1.2", + "ipaddr.js": "1.9.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "node_modules/pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/randomatic/node_modules/is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/randomatic/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomstring": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.1.5.tgz", + "integrity": "sha1-bfBij3XL1ZMpMNn+OrTpVqGFGMM=", + "dev": true, + "dependencies": { + "array-uniq": "1.0.2" + }, + "bin": { + "randomstring": "bin/randomstring" + }, + "engines": { + "node": "*" + } + }, + "node_modules/randomstring/node_modules/array-uniq": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz", + "integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/react": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/react/-/react-16.10.2.tgz", + "integrity": "sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.10.2.tgz", + "integrity": "sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.16.2" + }, + "peerDependencies": { + "react": "^16.0.0" + } + }, + "node_modules/react-fast-compare": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz", + "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==", + "dev": true + }, + "node_modules/react-helmet": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-5.2.1.tgz", + "integrity": "sha512-CnwD822LU8NDBnjCpZ4ySh8L6HYyngViTZLfBBb3NjtrpN8m49clH8hidHouq20I51Y6TpCTISCBbqiY5GamwA==", + "dev": true, + "dependencies": { + "object-assign": "^4.1.1", + "prop-types": "^15.5.4", + "react-fast-compare": "^2.0.2", + "react-side-effect": "^1.1.0" + }, + "peerDependencies": { + "react": ">=15.0.0" + } + }, + "node_modules/react-is": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.10.2.tgz", + "integrity": "sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA==" + }, + "node_modules/react-redux": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-6.0.1.tgz", + "integrity": "sha512-T52I52Kxhbqy/6TEfBv85rQSDz6+Y28V/pf52vDWs1YRXG19mcFOGfHnY2HsNFHyhP+ST34Aih98fvt6tqwVcQ==", + "dependencies": { + "@babel/runtime": "^7.3.1", + "hoist-non-react-statics": "^3.3.0", + "invariant": "^2.2.4", + "loose-envify": "^1.4.0", + "prop-types": "^15.7.2", + "react-is": "^16.8.2" + }, + "peerDependencies": { + "react": "^16.4.0-0", + "redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0" + } + }, + "node_modules/react-router": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-4.3.1.tgz", + "integrity": "sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg==", + "dependencies": { + "history": "^4.7.2", + "hoist-non-react-statics": "^2.5.0", + "invariant": "^2.2.4", + "loose-envify": "^1.3.1", + "path-to-regexp": "^1.7.0", + "prop-types": "^15.6.1", + "warning": "^4.0.1" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-dom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-4.3.1.tgz", + "integrity": "sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==", + "dependencies": { + "history": "^4.7.2", + "invariant": "^2.2.4", + "loose-envify": "^1.3.1", + "prop-types": "^15.6.1", + "react-router": "^4.3.1", + "warning": "^4.0.1" + }, + "peerDependencies": { + "react": ">=15" + } + }, + "node_modules/react-router-redux": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/react-router-redux/-/react-router-redux-4.0.8.tgz", + "integrity": "sha1-InQDWWtRUeGCN32rg1tdRfD4BU4=" + }, + "node_modules/react-router/node_modules/hoist-non-react-statics": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz", + "integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==" + }, + "node_modules/react-router/node_modules/path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/react-side-effect": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-1.2.0.tgz", + "integrity": "sha512-v1ht1aHg5k/thv56DRcjw+WtojuuDHFUgGfc+bFHOWsF4ZK6C2V57DO0Or0GPsg6+LSTE0M6Ry/gfzhzSwbc5w==", + "dev": true, + "dependencies": { + "shallowequal": "^1.0.1" + }, + "peerDependencies": { + "react": "^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/react-slick": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/react-slick/-/react-slick-0.23.2.tgz", + "integrity": "sha512-fM6DXX7+22eOcYE9cgaXUfioZL/Zw6fwS6aPMDBt0kLHl4H4fFNEbp4JsJQdEWMLUNFtUytNcvd9KRml22Tp5w==", + "dependencies": { + "classnames": "^2.2.5", + "enquire.js": "^2.1.6", + "json2mq": "^0.2.0", + "lodash.debounce": "^4.0.8", + "prettier": "^1.14.3", + "resize-observer-polyfill": "^1.5.0" + }, + "peerDependencies": { + "react": "^0.14.0 || ^15.0.1 || ^16.0.0", + "react-dom": "^0.14.0 || ^15.0.1 || ^16.0.0" + } + }, + "node_modules/react-slick/node_modules/prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readable-stream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/readdirp/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/readdirp/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readdirp/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redux": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/redux/-/redux-3.7.2.tgz", + "integrity": "sha512-pNqnf9q1hI5HHZRBkj3bAngGZW/JMCmexDlOxw4XagXY2o1327nHH54LoTjiPJ0gizoqPDRqWyX/00g0hD6w+A==", + "dependencies": { + "lodash": "^4.2.1", + "lodash-es": "^4.2.1", + "loose-envify": "^1.1.0", + "symbol-observable": "^1.0.3" + } + }, + "node_modules/redux-thunk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-2.3.0.tgz", + "integrity": "sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==" + }, + "node_modules/regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "node_modules/regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==" + }, + "node_modules/regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "dependencies": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "node_modules/regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "optional": true, + "dependencies": { + "is-equal-shallow": "^0.1.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "dependencies": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "node_modules/regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "dependencies": { + "is-finite": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/resize-observer-polyfill": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz", + "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" + }, + "node_modules/resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "dependencies": { + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-dir/node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pathname": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", + "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "dependencies": { + "aproba": "^1.1.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "node_modules/scheduler": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.16.2.tgz", + "integrity": "sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg==", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "node_modules/schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "dependencies": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + }, + "node_modules/serialize-javascript": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", + "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==", + "dev": true + }, + "node_modules/serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shallowequal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "dev": true + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "node_modules/slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "dependencies": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "dependencies": { + "source-map": "^0.5.6" + } + }, + "node_modules/source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.1" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-convert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", + "integrity": "sha1-aYLMMEn7tM2F+LJFaLnZvznu/5c=" + }, + "node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.8.tgz", + "integrity": "sha512-otmIRlRVmLChAWsnSFNO0Bfk6YySuBp6G9qrHiJwlLDd4mxe2ta4sjI7TzIR+W1nBMjilzrMcPOz9pSusgx3hQ==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.1.tgz", + "integrity": "sha512-ZXmmfiwtCLfz8WKZyYUuuHf3dMYEjg8NrjHMb0JqHVHVOSkzp3cW2/XG1fP3tRhqEqSzMwzzRQGtAPbs4Cncxg==", + "dev": true, + "dependencies": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^4.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/cacache": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/terser-webpack-plugin/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser-webpack-plugin/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/terser-webpack-plugin/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "dependencies": { + "figgy-pudding": "^3.5.1" + } + }, + "node_modules/terser-webpack-plugin/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/terser/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/terser/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/timers-browserify": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.11.tgz", + "integrity": "sha512-60aV6sgJ5YEbzUdn9c8kYGIqOubPoUdqQCul3SBAsRCZ40s6Y5cMcrW4dt3/k/EsbLVJNl9n6Vz3fTc+k2GeKQ==", + "dev": true, + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tiny-invariant": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.0.6.tgz", + "integrity": "sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA==" + }, + "node_modules/tiny-warning": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz", + "integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==" + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "node_modules/tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "node_modules/uglify-js": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.1.tgz", + "integrity": "sha512-+dSJLJpXBb6oMHP+Yvw8hUgElz4gLTh82XuX68QiJVTXaE5ibl6buzhNkQdYhBlIhozWOC9ge16wyRmjG4TwVQ==", + "dev": true, + "dependencies": { + "commander": "2.20.0", + "source-map": "~0.6.1" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/uglify-js/node_modules/commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "node_modules/uglify-js/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglifyjs-webpack-plugin": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-2.2.0.tgz", + "integrity": "sha512-mHSkufBmBuJ+KHQhv5H0MXijtsoA1lynJt1lXOaotja8/I0pR4L9oGaPIZw+bQBOFittXZg9OC1sXSGO9D9ZYg==", + "dev": true, + "dependencies": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", + "source-map": "^0.6.1", + "uglify-js": "^3.6.0", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^4.0.0" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/cacache": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "dependencies": { + "figgy-pudding": "^3.5.1" + } + }, + "node_modules/uglifyjs-webpack-plugin/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/unset-value/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url-loader": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-1.1.2.tgz", + "integrity": "sha512-dXHkKmw8FhPqu8asTc1puBfe3TehOCo2+RmOOev5suNCIYBcT626kxiWg1NBVkwc4rO8BGa7gP70W7VXuqHrjg==", + "dev": true, + "dependencies": { + "loader-utils": "^1.1.0", + "mime": "^2.0.3", + "schema-utils": "^1.0.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^3.0.0 || ^4.0.0" + } + }, + "node_modules/url-loader/node_modules/mime": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", + "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true, + "bin": { + "user-home": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", + "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", + "dev": true + }, + "node_modules/v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "dependencies": { + "user-home": "^1.1.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/value-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz", + "integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw==" + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "dependencies": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "node_modules/watchpack/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/watchpack/node_modules/anymatch/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/watchpack/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/watchpack/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/watchpack/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack/node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.0.tgz", + "integrity": "sha512-yNV98U4r7wX1VJAj5kyMsu36T8RPPQntcb5fJLOsMz/pt/WrKC0Vp1bAlqPLkA1LegSwQwf6P+kAbyhRKVQ72g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.1", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.1", + "watchpack": "^1.6.0", + "webpack-sources": "^1.4.1" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/webpack-cli": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.9.tgz", + "integrity": "sha512-xwnSxWl8nZtBl/AFJCOn9pG7s5CYUYdZxmmukv+fAHLcBIHM36dImfpQg3WfShZXeArkWlf6QRw24Klcsv8a5A==", + "dev": true, + "dependencies": { + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "enhanced-resolve": "4.1.0", + "findup-sync": "3.0.0", + "global-modules": "2.0.0", + "import-local": "2.0.0", + "interpret": "1.2.0", + "loader-utils": "1.2.3", + "supports-color": "6.1.0", + "v8-compile-cache": "2.0.3", + "yargs": "13.2.4" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=6.11.5" + }, + "peerDependencies": { + "webpack": "4.x.x" + } + }, + "node_modules/webpack-cli/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/webpack-cli/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/webpack-cli/node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/webpack-cli/node_modules/enhanced-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", + "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/webpack-cli/node_modules/supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "dependencies": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "node_modules/webpack-sources/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/webpack/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-fetch": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "dependencies": { + "errno": "~0.1.7" + } + }, + "node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "node_modules/yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "node_modules/yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "node_modules/yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/yargs/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + } + }, "dependencies": { "@adobe-mcid/visitor-js-server": { "version": "2.0.0", @@ -18,12 +9579,16 @@ "integrity": "sha1-SDrwi+GrSwv2s0hYpI1Uc9sIfVQ=" }, "@adobe/target-nodejs-sdk": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@adobe/target-nodejs-sdk/-/target-nodejs-sdk-1.0.3.tgz", - "integrity": "sha512-ClxCkTxPC1CqWO3SBagEdT9aVSXLhcZEYu5p9PI1vqqvmSJd9VLc3OdnKWY1GBNId8GT65OHoYTuriDJs+1DhA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@adobe/target-nodejs-sdk/-/target-nodejs-sdk-2.2.1.tgz", + "integrity": "sha512-PWw9JSDN/QOyYwB0myscnkzKawq8/49JETQFI2a5Fvg6szPYuaELrFgW3BIMF4Ng/GwLmxhbI7J1+WoyvTpFCQ==", "requires": { "@adobe-mcid/visitor-js-server": "^2.0.0", - "request": "^2.81.0" + "fast-text-encoding": "^1.0.3", + "form-data": "^3.0.0", + "http-status-codes": "^1.4.0", + "node-fetch": "^2.6.1", + "whatwg-fetch": "^3.0.0" } }, "@babel/runtime": { @@ -241,6 +9806,7 @@ "version": "6.10.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, "requires": { "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", @@ -252,13 +9818,15 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", - "dev": true + "dev": true, + "requires": {} }, "ajv-keywords": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true + "dev": true, + "requires": {} }, "ansi-regex": { "version": "2.1.1", @@ -338,14 +9906,6 @@ "dev": true, "optional": true }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, "asn1.js": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", @@ -384,11 +9944,6 @@ } } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, "assign-symbols": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", @@ -412,16 +9967,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, "axios": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", @@ -1342,14 +10887,6 @@ "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -1610,11 +11147,6 @@ "integrity": "sha512-1CUyKyecPeksKwXZvYw0tEoaMCo/RwBlXmEtN5vVnabvO0KPd9RQLcaAuR9/1F+KDMv6esmOFWlsXuzDk+8rxg==", "dev": true }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -1920,7 +11452,8 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true }, "create-ecdh": { "version": "4.0.3", @@ -1997,14 +11530,6 @@ "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", "dev": true }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -2162,15 +11687,6 @@ "stream-shift": "^1.0.0" } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2419,11 +11935,6 @@ } } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, "extend-shallow": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", @@ -2455,20 +11966,22 @@ "is-extglob": "^1.0.0" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" }, "figgy-pudding": { "version": "3.5.1", @@ -2903,18 +12416,13 @@ "for-in": "^1.0.1" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", + "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", "requires": { "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", + "combined-stream": "^1.0.8", "mime-types": "^2.1.12" } }, @@ -3440,24 +12948,24 @@ "dev": true, "optional": true }, - "string-width": { - "version": "1.0.2", + "string_decoder": { + "version": "1.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "safe-buffer": "~5.1.0" } }, - "string_decoder": { - "version": "1.1.1", + "string-width": { + "version": "1.0.2", "bundled": true, "dev": true, "optional": true, "requires": { - "safe-buffer": "~5.1.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -3552,14 +13060,6 @@ "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, "glob": { "version": "7.1.4", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", @@ -3662,20 +13162,6 @@ "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==", "dev": true }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -3840,15 +13326,10 @@ "toidentifier": "1.0.0" } }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } + "http-status-codes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-status-codes/-/http-status-codes-1.4.0.tgz", + "integrity": "sha512-JrT3ua+WgH8zBD3HEJYbeEgnuQaAnUeRRko/YojPAJjGmIfGD3KPU/asLdsLwKjfxOmQe5nXMQ0pt/7MyapVbQ==" }, "https-browserify": { "version": "1.0.0", @@ -4157,11 +13638,6 @@ "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -4204,21 +13680,11 @@ } } }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -4231,20 +13697,11 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json2mq": { "version": "0.2.0", @@ -4260,17 +13717,6 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - } - }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -4680,6 +14126,11 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" + }, "node-libs-browser": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", @@ -4744,11 +14195,6 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5038,11 +14484,6 @@ "sha.js": "^2.4.8" } }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -5072,9 +14513,9 @@ "optional": true }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==" + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.0.tgz", + "integrity": "sha512-DsEPLY1dE5HF3BxCRBmD4uYZ+5DCbvatnolqTqcxEgKVZnL2kUfyu7b8pPQ5+hTBkdhU9SLUmK0/pHb07RE4WQ==" }, "private": { "version": "0.1.8", @@ -5131,11 +14572,6 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, "public-encrypt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", @@ -5174,7 +14610,8 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true }, "qs": { "version": "6.7.0", @@ -5397,6 +14834,13 @@ "lodash.debounce": "^4.0.8", "prettier": "^1.14.3", "resize-observer-polyfill": "^1.5.0" + }, + "dependencies": { + "prettier": { + "version": "1.19.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", + "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==" + } } }, "readable-stream": { @@ -5843,40 +15287,6 @@ "is-finite": "^1.0.0" } }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" - } - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6330,22 +15740,6 @@ "extend-shallow": "^3.0.0" } }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, "ssri": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", @@ -6420,6 +15814,15 @@ "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", "dev": true }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-convert": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/string-convert/-/string-convert-0.2.1.tgz", @@ -6453,15 +15856,6 @@ } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -6790,22 +16184,6 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -6824,19 +16202,6 @@ "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", "dev": true }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -7152,6 +16517,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, "requires": { "punycode": "^2.1.0" } @@ -7231,11 +16597,6 @@ "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" - }, "v8-compile-cache": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", @@ -7261,16 +16622,6 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, "vm-browserify": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", @@ -8082,6 +17433,11 @@ } } }, + "whatwg-fetch": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", + "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/react-shopping-cart-demo/package.json b/react-shopping-cart-demo/package.json index b927b76..1687de7 100644 --- a/react-shopping-cart-demo/package.json +++ b/react-shopping-cart-demo/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "webpack --mode=development", "build": "webpack --mode=production", - "start": "PORT=4444 node server.js" + "start": "PORT=80 node server.js" }, "repository": { "type": "git", @@ -19,6 +19,7 @@ "axios": "^0.19.0", "cookie-parser": "^1.4.4", "express": "^4.16.4", + "prettier": "^2.4.0", "react": "^16.8.1", "react-dom": "^16.8.1", "react-redux": "^6.0.0", @@ -33,8 +34,8 @@ "babel-cli": "^6.26.0", "babel-core": "^6.26.3", "babel-loader": "^7.1.5", - "babel-preset-es2015": "^6.18.0", "babel-preset-env": "^1.7.0", + "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.24.1", "copy-webpack-plugin": "^4.6.0", "file-loader": "^3.0.1", diff --git a/react-shopping-cart-demo/public/AppMeasurement.js b/react-shopping-cart-demo/public/AppMeasurement.js index 8b62d77..42976c3 100644 --- a/react-shopping-cart-demo/public/AppMeasurement.js +++ b/react-shopping-cart-demo/public/AppMeasurement.js @@ -1,9 +1,9 @@ //initialize AppMeasurement -var s_account="adobetargetmobilewesteros" +var s_account="targetdataplatform" var s=s_gi(s_account) /******** VISITOR ID SERVICE CONFIG - REQUIRES VisitorAPI.js ********/ -s.visitor=Visitor.getInstance("B8A054D958807F770A495DD6@AdobeOrg") +s.visitor=Visitor.getInstance("6FC947105BB267B70A495EE9@AdobeOrg") /************************** CONFIG SECTION **************************/ /* You may add or alter any code config here. */ @@ -32,8 +32,8 @@ s.linkTrackEvents="None" /* WARNING: Changing any of the below variables will cause drastic changes to how your visitor data is collected. Changes should only be made when instructed to do so by your account manager.*/ -s.trackingServer="adobetargetmobile.sc.omtrdc.net" -s.trackingServerSecure="adobetargetmobile.sc.omtrdc.net" +s.trackingServer="targetdataplatform.sc.omtrdc.net" +s.trackingServerSecure="targetdataplatform.sc.omtrdc.net" /* Start ActivityMap Module diff --git a/react-shopping-cart-demo/public/assets/js/app.js b/react-shopping-cart-demo/public/assets/js/app.js index 213eb21..ebff76f 100644 --- a/react-shopping-cart-demo/public/assets/js/app.js +++ b/react-shopping-cart-demo/public/assets/js/app.js @@ -47,7 +47,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,b=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case l:case d:case a:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case f:case h:case c:return e;default:return t}}case y:case m:case o:return t}}}function E(e){return _(e)===d}t.typeOf=_,t.AsyncMode=l,t.ConcurrentMode=d,t.ContextConsumer=f,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===u||e===s||e===p||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===f||e.$$typeof===h||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w)},t.isAsyncMode=function(e){return E(e)||_(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===f},t.isContextProvider=function(e){return _(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return _(e)===h},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===y},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===u},t.isStrictMode=function(e){return _(e)===s},t.isSuspense=function(e){return _(e)===p}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(i){return"function"==typeof i?i(r,n,e):t(i)}}}}r.r(t);var i=n();i.withExtraArgument=n,t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(53),i=d(r(149)),o=d(r(150)),a=d(r(151)),s=d(r(152)),u=d(r(153)),c=d(r(154)),f=d(r(155)),l=r(79);function d(e){return e&&e.__esModule?e:{default:e}}t.default=(0,n.combineReducers)({AboutReducer:i.default,ProductsReducer:o.default,LatestProductsReducer:a.default,ProductReducer:s.default,LoadingReducer:u.default,CartReducer:c.default,WishlistReducer:f.default,routing:l.routerReducer})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:{title:"",content:""}},t=arguments[1];switch(t.type){case"REQUEST_ABOUT":return Object.assign({},e,{fetching:!0,data:{title:"",content:""}});case"RECEIVE_ABOUT":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:[]},t=arguments[1];switch(t.type){case"REQUEST_PRODUCTS":return Object.assign({},e,{fetching:!0,data:[]});case"RECEIVE_PRODUCTS":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:[]},t=arguments[1];switch(t.type){case"REQUEST_LATEST_PRODUCTS":return Object.assign({},e,{fetching:!0,data:[]});case"RECEIVE_LATEST_PRODUCTS":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_PRODUCT":return Object.assign({},e,{fetching:!0,data:{}});case"RECEIVE_PRODUCT":var r=t.payload.filter((function(e){return e.id==t.id}));return Object.assign({},e,{fetching:!1,data:r[0]});case"CLEAR_PRODUCT":return Object.assign({},e,{fetching:!1,data:{}});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isVisible:!1},t=arguments[1];switch(t.type){case"SHOW_LOADING":return Object.assign({},e,{isVisible:!0});case"HIDE_LOADING":return Object.assign({},e,{isVisible:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_ADD_TO_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_ADD_TO_CART":return Object.assign({},e,{loading:!1});case"REQUEST_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_CART":return Object.assign({},e,{loading:!1,data:t.payload});case"REQUEST_REMOVE_FROM_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_REMOVE_FROM_CART":return Object.assign({},e,{loading:!1});case"REQUEST_DELETE_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_DELETE_CART":return Object.assign({},e,{loading:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_ADD_TO_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_ADD_TO_WL":return Object.assign({},e,{loading:!1});case"REQUEST_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_WL":return Object.assign({},e,{loading:!1,data:t.payload});case"REQUEST_REMOVE_FROM_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_REMOVE_FROM_WL":return Object.assign({},e,{loading:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},a=r.selectLocationState,s=void 0===a?o:a,u=r.adjustUrlOnReplay,c=void 0===u||u;if(void 0===s(t.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var f=void 0,l=void 0,d=void 0,h=void 0,p=void 0,b=function(e){return s(t.getState()).locationBeforeTransitions||(e?f:void 0)};if(f=b(),c){var m=function(){var t=b(!0);p!==t&&f!==t&&(l=!0,p=t,e.transitionTo(n({},t,{action:"PUSH"})),l=!1)};d=t.subscribe(m),m()}var y=function(e){l||(p=e,!f&&(f=e,b())||t.dispatch({type:i.LOCATION_CHANGE,payload:e}))};h=e.listen(y),e.getCurrentLocation&&y(e.getCurrentLocation());return n({},e,{listen:function(r){var n=b(!0),i=!1,o=t.subscribe((function(){var e=b(!0);e!==n&&(n=e,i||r(n))}));return e.getCurrentLocation||r(n),function(){i=!0,o()}},unsubscribe:function(){c&&d(),h()}})};var i=r(80),o=function(e){return e.routing}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){return function(t){return function(r){if(r.type!==n.CALL_HISTORY_METHOD)return t(r);var i=r.payload,o=i.method,a=i.args;e[o].apply(e,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0;)for(var u=o(Math.ceil(256*t/s)),c=0;c0;c++){var f=u.readUInt8(c);f0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*b}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){},function(e,t,r){"use strict";var n=r(3).Buffer,i=r(168);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(170),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(9))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+f(h,i,o,s)+u+r[d]+a[h];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(28),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=c(n)+l(p,i,o,s)+u+r[h]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(88),o=r(28),a=r(3).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(2),i=r(89),o=r(28),a=r(3).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(2),i=r(3).Buffer,o=r(19),a=i.alloc(128),s=64;function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},c.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,o=d}a.rip(s,o,n,i)},c.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],f=e.keys[u+1];a.expand(o,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var l=a.substitute(c,f),d=o;o=(s^a.permute(l))>>>0,s=d}a.rip(o,s,n,i)}},function(e,t,r){"use strict";var n=r(12),i=r(2),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(100),i=r(3).Buffer,o=r(67),a=r(101),s=r(19),u=r(37),c=r(38);function f(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new f(s.module,t,r)}r(2)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(102),i=r(205),o=r(206);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(8).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(6),i=new(r(103)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),c=new n(7),f=r(102),l=r(27);function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=b;var p={};function b(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var l,d=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(c)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new n(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length0&&r.ishrn(n),r}function l(e,r,i){var o,a;do{for(o=new t(0);8*o.length=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(l)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(6),i=r(2),o=r(39),a=r(13);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(13),i=r(6),o=r(2),a=r(39),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(214),t.sha224=r(215),t.sha256=r(107),t.sha384=r(216),t.sha512=r(108)},function(e,t,r){"use strict";var n=r(15),i=r(33),o=r(106),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new f({r:m,s:y,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=c.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(72),i=r(104),o=r(12);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(6),i=r(13),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(u(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=u(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=u(e,r);if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(72),i=r(71),o=r(13),a=o.assert,s=o.parseBytes,u=r(225),c=r(226);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,r,u,c,f){var l=o(u);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,r,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,a=r.data.q,u=r.data.g,c=r.data.pub_key,f=o.signature.decode(e,"der"),l=f.s,d=f.r;s(l,a),s(d,a);var h=n.mont(i),p=l.invm(a);return 0===u.toRed(h).redPow(new n(t).mul(p).mod(a)).fromRed().mul(c.toRed(h).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(e,r,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");r=t.concat([f,r]);for(var d=l.modulus.byteLength(),h=[1],p=0;r.length+h.length+2r-d-2)throw new Error("message too long");var h=l.alloc(r-n-d-2),p=r-f-1,b=i(f),m=s(l.concat([c,h,l.alloc(1,1),t],p),a(b,p)),y=s(b,a(m,f));return new u(l.concat([l.alloc(1),y,m],r))}(p,t);else if(1===d)h=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?f(h,p):c(h,p)}},function(e,t,r){var n=r(40),i=r(114),o=r(115),a=r(6),s=r(69),u=r(30),c=r(116),f=r(3).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var d,h=n(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?c(new a(t),h):s(t,h);var b=f.alloc(p-d.length);if(d=f.concat([b,d],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),l=o(s,i(c,a)),d=o(c,i(l,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===l)return d;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(3),a=r(27),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function h(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return c.getRandomValues(s),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return a(r).copy(e,t),e;a(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}c&&c.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(r,t.length),d(n,r,t.length),h(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,t.length),void 0===n&&(n=t.length-r);return d(n,r,t.length),h(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(9),r(17))},function(e,t,r){var n=r(247);function i(){this.chars=""}i.prototype.setType=function(e){var t,r="abcdefghijklmnopqrstuvwxyz",n=r.toUpperCase();t="alphanumeric"===e?"0123456789"+r+n:"numeric"===e?"0123456789":"alphabetic"===e?r+n:"hex"===e?"0123456789abcdef":e,this.chars=t},i.prototype.removeUnreadable=function(){this.chars=this.chars.replace(/[0OIl]/g,"")},i.prototype.setcapitalization=function(e){"uppercase"===e?this.chars=this.chars.toUpperCase():"lowercase"===e&&(this.chars=this.chars.toLowerCase())},i.prototype.removeDuplicates=function(){var e=this.chars.split("");e=n(e),this.chars=e.join("")},e.exports=i},function(e,t,r){"use strict";(function(t){var r;"Set"in t?"function"==typeof Set.prototype.forEach&&(r=!1,new Set([!0]).forEach((function(e){r=e})),!0===r)?e.exports=function(e){var t=[];return new Set(e).forEach((function(e){t.push(e)})),t}:e.exports=function(e){var t=new Set;return e.filter((function(e){if(!t.has(e))return t.add(e),!0}))}:e.exports=function(e){for(var t=[],r=0;r1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},l=function(e){var t=m(e,s.TAG_NAMES.TITLE),r=m(e,s.HELMET_PROPS.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,(function(){return t}));var n=m(e,s.HELMET_PROPS.DEFAULT_TITLE);return t||n||void 0},d=function(e){return m(e,s.HELMET_PROPS.ON_CHANGE_CLIENT_STATE)||function(){}},h=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return i({},e,t)}),{})},p=function(e,t){return t.filter((function(e){return void 0!==e[s.TAG_NAMES.BASE]})).map((function(e){return e[s.TAG_NAMES.BASE]})).reverse().reduce((function(t,r){if(!t.length)for(var n=Object.keys(r),i=0;i=0;r--){var n=e[r];if(n.hasOwnProperty(t))return n[t]}return null},y=(c=Date.now(),function(e){var t=Date.now();t-c>16?(c=t,e(t)):setTimeout((function(){y(e)}),0)}),v=function(e){return clearTimeout(e)},g="undefined"!=typeof window?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||y:e.requestAnimationFrame||y,w="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||v:e.cancelAnimationFrame||v,_=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},E=null,S=function(e,t){var r=e.baseTag,n=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,u=e.noscriptTags,c=e.onChangeClientState,f=e.scriptTags,l=e.styleTags,d=e.title,h=e.titleAttributes;x(s.TAG_NAMES.BODY,n),x(s.TAG_NAMES.HTML,i),T(d,h);var p={baseTag:M(s.TAG_NAMES.BASE,r),linkTags:M(s.TAG_NAMES.LINK,o),metaTags:M(s.TAG_NAMES.META,a),noscriptTags:M(s.TAG_NAMES.NOSCRIPT,u),scriptTags:M(s.TAG_NAMES.SCRIPT,f),styleTags:M(s.TAG_NAMES.STYLE,l)},b={},m={};Object.keys(p).forEach((function(e){var t=p[e],r=t.newTags,n=t.oldTags;r.length&&(b[e]=r),n.length&&(m[e]=p[e].oldTags)})),t&&t(),c(e,b,m)},k=function(e){return Array.isArray(e)?e.join(""):e},T=function(e,t){void 0!==e&&document.title!==e&&(document.title=k(e)),x(s.TAG_NAMES.TITLE,t)},x=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute(s.HELMET_ATTRIBUTE),i=n?n.split(","):[],o=[].concat(i),a=Object.keys(t),u=0;u=0;d--)r.removeAttribute(o[d]);i.length===o.length?r.removeAttribute(s.HELMET_ATTRIBUTE):r.getAttribute(s.HELMET_ATTRIBUTE)!==a.join(",")&&r.setAttribute(s.HELMET_ATTRIBUTE,a.join(","))}},M=function(e,t){var r=document.head||document.querySelector(s.TAG_NAMES.HEAD),n=r.querySelectorAll(e+"["+s.HELMET_ATTRIBUTE+"]"),i=Array.prototype.slice.call(n),o=[],a=void 0;return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var n in t)if(t.hasOwnProperty(n))if(n===s.TAG_PROPERTIES.INNER_HTML)r.innerHTML=t.innerHTML;else if(n===s.TAG_PROPERTIES.CSS_TEXT)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{var u=void 0===t[n]?"":t[n];r.setAttribute(n,u)}r.setAttribute(s.HELMET_ATTRIBUTE,"true"),i.some((function(e,t){return a=t,r.isEqualNode(e)}))?i.splice(a,1):o.push(r)})),i.forEach((function(e){return e.parentNode.removeChild(e)})),o.forEach((function(e){return r.appendChild(e)})),{oldTags:i,newTags:o}},C=function(e){return Object.keys(e).reduce((function(t,r){var n=void 0!==e[r]?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n}),"")},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[s.REACT_TAG_MAP[r]||r]=e[r],t}),t)},P=function(e,t,r){switch(e){case s.TAG_NAMES.TITLE:return{toComponent:function(){return e=t.title,r=t.titleAttributes,(n={key:e})[s.HELMET_ATTRIBUTE]=!0,i=O(r,n),[o.default.createElement(s.TAG_NAMES.TITLE,i,e)];var e,r,n,i},toString:function(){return function(e,t,r,n){var i=C(r),o=k(t);return i?"<"+e+" "+s.HELMET_ATTRIBUTE+'="true" '+i+">"+f(o,n)+"":"<"+e+" "+s.HELMET_ATTRIBUTE+'="true">'+f(o,n)+""}(e,t.title,t.titleAttributes,r)}};case s.ATTRIBUTE_NAMES.BODY:case s.ATTRIBUTE_NAMES.HTML:return{toComponent:function(){return O(t)},toString:function(){return C(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,r){var n,i=((n={key:r})[s.HELMET_ATTRIBUTE]=!0,n);return Object.keys(t).forEach((function(e){var r=s.REACT_TAG_MAP[e]||e;if(r===s.TAG_PROPERTIES.INNER_HTML||r===s.TAG_PROPERTIES.CSS_TEXT){var n=t.innerHTML||t.cssText;i.dangerouslySetInnerHTML={__html:n}}else i[r]=t[e]})),o.default.createElement(e,i)}))}(e,t)},toString:function(){return function(e,t,r){return t.reduce((function(t,n){var i=Object.keys(n).filter((function(e){return!(e===s.TAG_PROPERTIES.INNER_HTML||e===s.TAG_PROPERTIES.CSS_TEXT)})).reduce((function(e,t){var i=void 0===n[t]?t:t+'="'+f(n[t],r)+'"';return e?e+" "+i:i}),""),o=n.innerHTML||n.cssText||"",a=-1===s.SELF_CLOSING_TAGS.indexOf(e);return t+"<"+e+" "+s.HELMET_ATTRIBUTE+'="true" '+i+(a?"/>":">"+o+"")}),"")}(e,t,r)}}}};t.convertReactPropstoHtmlAttributes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[s.HTML_TAG_MAP[r]||r]=e[r],t}),t)},t.handleClientStateChange=function(e){E&&w(E),e.defer?E=g((function(){S(e,(function(){E=null}))})):(S(e),E=null)},t.mapStateOnServer=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,u=e.noscriptTags,c=e.scriptTags,f=e.styleTags,l=e.title,d=void 0===l?"":l,h=e.titleAttributes;return{base:P(s.TAG_NAMES.BASE,t,n),bodyAttributes:P(s.ATTRIBUTE_NAMES.BODY,r,n),htmlAttributes:P(s.ATTRIBUTE_NAMES.HTML,i,n),link:P(s.TAG_NAMES.LINK,o,n),meta:P(s.TAG_NAMES.META,a,n),noscript:P(s.TAG_NAMES.NOSCRIPT,u,n),script:P(s.TAG_NAMES.SCRIPT,c,n),style:P(s.TAG_NAMES.STYLE,f,n),title:P(s.TAG_NAMES.TITLE,{title:d,titleAttributes:h},n)}},t.reducePropsToState=function(e){return{baseTag:p([s.TAG_PROPERTIES.HREF],e),bodyAttributes:h(s.ATTRIBUTE_NAMES.BODY,e),defer:m(e,s.HELMET_PROPS.DEFER),encode:m(e,s.HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:h(s.ATTRIBUTE_NAMES.HTML,e),linkTags:b(s.TAG_NAMES.LINK,[s.TAG_PROPERTIES.REL,s.TAG_PROPERTIES.HREF],e),metaTags:b(s.TAG_NAMES.META,[s.TAG_PROPERTIES.NAME,s.TAG_PROPERTIES.CHARSET,s.TAG_PROPERTIES.HTTPEQUIV,s.TAG_PROPERTIES.PROPERTY,s.TAG_PROPERTIES.ITEM_PROP],e),noscriptTags:b(s.TAG_NAMES.NOSCRIPT,[s.TAG_PROPERTIES.INNER_HTML],e),onChangeClientState:d(e),scriptTags:b(s.TAG_NAMES.SCRIPT,[s.TAG_PROPERTIES.SRC,s.TAG_PROPERTIES.INNER_HTML],e),styleTags:b(s.TAG_NAMES.STYLE,[s.TAG_PROPERTIES.CSS_TEXT],e),title:l(e),titleAttributes:h(s.ATTRIBUTE_NAMES.TITLE,e)}},t.requestAnimationFrame=g,t.warn=_}).call(this,r(9))},function(e,t,r){"use strict";var n=r(10),i=r(119),o=r(254),a=r(125);function s(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=s(r(122));u.Axios=o,u.create=function(e){return s(a(u.defaults,e))},u.Cancel=r(126),u.CancelToken=r(266),u.isCancel=r(121),u.all=function(e){return Promise.all(e)},u.spread=r(267),e.exports=u,e.exports.default=u},function(e,t){ + */Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&Symbol.for,i=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,f=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,h=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,b=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,y=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.fundamental"):60117,g=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case l:case d:case a:case u:case s:case p:return e;default:switch(e=e&&e.$$typeof){case f:case h:case c:return e;default:return t}}case y:case m:case o:return t}}}function E(e){return _(e)===d}t.typeOf=_,t.AsyncMode=l,t.ConcurrentMode=d,t.ContextConsumer=f,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=a,t.Lazy=y,t.Memo=m,t.Portal=o,t.Profiler=u,t.StrictMode=s,t.Suspense=p,t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===u||e===s||e===p||e===b||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===m||e.$$typeof===c||e.$$typeof===f||e.$$typeof===h||e.$$typeof===v||e.$$typeof===g||e.$$typeof===w)},t.isAsyncMode=function(e){return E(e)||_(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===f},t.isContextProvider=function(e){return _(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return _(e)===h},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===y},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===o},t.isProfiler=function(e){return _(e)===u},t.isStrictMode=function(e){return _(e)===s},t.isSuspense=function(e){return _(e)===p}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(i){return"function"==typeof i?i(r,n,e):t(i)}}}}r.r(t);var i=n();i.withExtraArgument=n,t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(53),i=d(r(149)),o=d(r(150)),a=d(r(151)),s=d(r(152)),u=d(r(153)),c=d(r(154)),f=d(r(155)),l=r(79);function d(e){return e&&e.__esModule?e:{default:e}}t.default=(0,n.combineReducers)({AboutReducer:i.default,ProductsReducer:o.default,LatestProductsReducer:a.default,ProductReducer:s.default,LoadingReducer:u.default,CartReducer:c.default,WishlistReducer:f.default,routing:l.routerReducer})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:{title:"",content:""}},t=arguments[1];switch(t.type){case"REQUEST_ABOUT":return Object.assign({},e,{fetching:!0,data:{title:"",content:""}});case"RECEIVE_ABOUT":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:[]},t=arguments[1];switch(t.type){case"REQUEST_PRODUCTS":return Object.assign({},e,{fetching:!0,data:[]});case"RECEIVE_PRODUCTS":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:[]},t=arguments[1];switch(t.type){case"REQUEST_LATEST_PRODUCTS":return Object.assign({},e,{fetching:!0,data:[]});case"RECEIVE_LATEST_PRODUCTS":return Object.assign({},e,{fetching:!1,data:t.payload});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{fetching:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_PRODUCT":return Object.assign({},e,{fetching:!0,data:{}});case"RECEIVE_PRODUCT":var r=t.payload.filter((function(e){return e.id==t.id}));return Object.assign({},e,{fetching:!1,data:r[0]});case"CLEAR_PRODUCT":return Object.assign({},e,{fetching:!1,data:{}});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isVisible:!1},t=arguments[1];switch(t.type){case"SHOW_LOADING":return Object.assign({},e,{isVisible:!0});case"HIDE_LOADING":return Object.assign({},e,{isVisible:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_ADD_TO_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_ADD_TO_CART":return Object.assign({},e,{loading:!1});case"REQUEST_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_CART":return Object.assign({},e,{loading:!1,data:t.payload});case"REQUEST_REMOVE_FROM_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_REMOVE_FROM_CART":return Object.assign({},e,{loading:!1});case"REQUEST_DELETE_CART":return Object.assign({},e,{loading:!0});case"RECEIVE_DELETE_CART":return Object.assign({},e,{loading:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{loading:!1,data:{}},t=arguments[1];switch(t.type){case"REQUEST_ADD_TO_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_ADD_TO_WL":return Object.assign({},e,{loading:!1});case"REQUEST_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_WL":return Object.assign({},e,{loading:!1,data:t.payload});case"REQUEST_REMOVE_FROM_WL":return Object.assign({},e,{loading:!0});case"RECEIVE_REMOVE_FROM_WL":return Object.assign({},e,{loading:!1});default:return e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{},a=r.selectLocationState,s=void 0===a?o:a,u=r.adjustUrlOnReplay,c=void 0===u||u;if(void 0===s(t.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var f=void 0,l=void 0,d=void 0,h=void 0,p=void 0,b=function(e){return s(t.getState()).locationBeforeTransitions||(e?f:void 0)};if(f=b(),c){var m=function(){var t=b(!0);p!==t&&f!==t&&(l=!0,p=t,e.transitionTo(n({},t,{action:"PUSH"})),l=!1)};d=t.subscribe(m),m()}var y=function(e){l||(p=e,!f&&(f=e,b())||t.dispatch({type:i.LOCATION_CHANGE,payload:e}))};h=e.listen(y),e.getCurrentLocation&&y(e.getCurrentLocation());return n({},e,{listen:function(r){var n=b(!0),i=!1,o=t.subscribe((function(){var e=b(!0);e!==n&&(n=e,i||r(n))}));return e.getCurrentLocation||r(n),function(){i=!0,o()}},unsubscribe:function(){c&&d(),h()}})};var i=r(80),o=function(e){return e.routing}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(){return function(t){return function(r){if(r.type!==n.CALL_HISTORY_METHOD)return t(r);var i=r.payload,o=i.method,a=i.args;e[o].apply(e,function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t0;)for(var u=o(Math.ceil(256*t/s)),c=0;c0;c++){var f=u.readUInt8(c);f0?a-4:a;for(r=0;r>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o,a=[],s=t;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,o=h&(1<<-f)-1,h>>=-f,f+=s;f>0;o=256*o+e[t+l],l+=d,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*b}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t){},function(e,t,r){"use strict";var n=r(3).Buffer,i=r(168);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(170),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(9))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var h=~~(d/20),p=0|((t=n)<<5|t>>>27)+f(h,i,o,s)+u+r[d]+a[h];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(28),o=r(3).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var h=0;h<80;++h){var p=~~(h/20),b=c(n)+l(p,i,o,s)+u+r[h]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(2),i=r(88),o=r(28),a=r(3).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(2),i=r(89),o=r(28),a=r(3).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(2),i=r(3).Buffer,o=r(19),a=i.alloc(128),s=64;function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u>>n[u]&1;for(u=s;u>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},c.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},c.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n>>0,o=d}a.rip(s,o,n,i)},c.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],f=e.keys[u+1];a.expand(o,e.tmp,0),c^=e.tmp[0],f^=e.tmp[1];var l=a.substitute(c,f),d=o;o=(s^a.permute(l))>>>0,s=d}a.rip(o,s,n,i)}},function(e,t,r){"use strict";var n=r(12),i=r(2),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(100),i=r(3).Buffer,o=r(67),a=r(101),s=r(19),u=r(37),c=r(38);function f(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new f(s.module,t,r)}r(2)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},t.createDecipheriv=d},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(102),i=r(205),o=r(206);var a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(8).Buffer)},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(6),i=new(r(103)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),c=new n(7),f=r(102),l=r(27);function d(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=b;var p={};function b(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var l,d=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(o).cmp(a)&&(d+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(c)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new n(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length0&&r.ishrn(n),r}function l(e,r,i){var o,a;do{for(o=new t(0);8*o.length","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^1.4.3","coveralls":"^3.0.4","grunt":"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.2","jscs":"^3.0.7","jshint":"^2.6.0","mocha":"^6.1.4"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"}}')},function(e,t,r){"use strict";var n=r(13),i=r(6),o=r(2),a=r(39),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),y=new i(1),v=0;0!==d.cmpn(0);){var g=h.div(d);c=h.sub(g.mul(d)),f=m.sub(g.mul(p));var w=y.sub(g.mul(b));if(!n&&c.cmp(l)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++v)break;u=c,h=d,d=c,m=p,p=f,y=b,b=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=n.redMul(c),d=u.redSqr().redIAdd(f).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),d=s.redMul(f.redISub(l)).redISub(i.redMul(c)),h=this.z.redMul(a);return this.curve.jpoint(l,d,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(6),i=r(2),o=r(39),a=r(13);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(13),i=r(6),o=r(2),a=r(39),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},c.prototype._projDbl=function(){var e,t,r,n=this.x.redAdd(this.y).redSqr(),i=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(i)).redAdd(o);if(this.zOne)e=n.redSub(i).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=n.redSub(i).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=i.redAdd(o);s=this.curve._mulC(this.z).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(n.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(i.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),d=a.redMul(s);return this.curve.point(c,f,d,l)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t,r){"use strict";t.sha1=r(214),t.sha224=r(215),t.sha256=r(107),t.sha384=r(216),t.sha512=r(108)},function(e,t,r){"use strict";var n=r(15),i=r(33),o=r(106),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,f),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t0))return a.iaddn(1),this.keyFromPrivate(a)}},l.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),l=this.n.sub(new n(1)),d=0;;d++){var h=o.k?o.k(d):new n(c.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(l)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var y=h.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new f({r:m,s:y,recoveryParam:v})}}}}}},l.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),l=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),l)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(o),p=o.sub(a).mul(h).umod(o),b=c.mul(h).umod(o);return this.g.mulAdd(p,s,b)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(72),i=r(104),o=r(12);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length"}},function(e,t,r){"use strict";var n=r(6),i=r(13),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;for(var n=15&r,i=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;if(u(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=u(e,r),a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=u(e,r);if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===f[0]&&128&f[1]&&(f=f.slice(1)),this.r=new n(a),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(72),i=r(71),o=r(13),a=o.assert,s=o.parseBytes,u=r(225),c=r(226);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=i[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t=t)throw new Error("invalid sig")}e.exports=function(e,r,u,c,f){var l=o(u);if("ec"===l.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=a[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var o=new i(n),s=r.data.subjectPrivateKey.data;return o.verify(t,e,s)}(e,r,l)}if("dsa"===l.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,a=r.data.q,u=r.data.g,c=r.data.pub_key,f=o.signature.decode(e,"der"),l=f.s,d=f.r;s(l,a),s(d,a);var h=n.mont(i),p=l.invm(a);return 0===u.toRed(h).redPow(new n(t).mul(p).mod(a)).fromRed().mul(c.toRed(h).redPow(d.mul(p).mod(a)).fromRed()).mod(i).mod(a).cmp(d)}(e,r,l)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");r=t.concat([f,r]);for(var d=l.modulus.byteLength(),h=[1],p=0;r.length+h.length+2r-d-2)throw new Error("message too long");var h=l.alloc(r-n-d-2),p=r-f-1,b=i(f),m=s(l.concat([c,h,l.alloc(1,1),t],p),a(b,p)),y=s(b,a(m,f));return new u(l.concat([l.alloc(1),y,m],r))}(p,t);else if(1===d)h=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?l.alloc(a-o-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return r?f(h,p):c(h,p)}},function(e,t,r){var n=r(40),i=r(114),o=r(115),a=r(6),s=r(69),u=r(30),c=r(116),f=r(3).Buffer;e.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var d,h=n(e),p=h.modulus.byteLength();if(t.length>p||new a(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?c(new a(t),h):s(t,h);var b=f.alloc(p-d.length);if(d=f.concat([b,d],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),l=o(s,i(c,a)),d=o(c,i(l,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===l)return d;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(3),a=r(27),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function h(e,t,r,i){if(n.browser){var o=e.buffer,s=new Uint8Array(o,t,r);return c.getRandomValues(s),i?void n.nextTick((function(){i(null,e)})):e}if(!i)return a(r).copy(e,t),e;a(r,(function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)}))}c&&c.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(r,t.length),d(n,r,t.length),h(t,r,n,i)},t.randomFillSync=function(t,r,n){void 0===r&&(r=0);if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(r,t.length),void 0===n&&(n=t.length-r);return d(n,r,t.length),h(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(9),r(17))},function(e,t,r){var n=r(247);function i(){this.chars=""}i.prototype.setType=function(e){var t,r="abcdefghijklmnopqrstuvwxyz",n=r.toUpperCase();t="alphanumeric"===e?"0123456789"+r+n:"numeric"===e?"0123456789":"alphabetic"===e?r+n:"hex"===e?"0123456789abcdef":e,this.chars=t},i.prototype.removeUnreadable=function(){this.chars=this.chars.replace(/[0OIl]/g,"")},i.prototype.setcapitalization=function(e){"uppercase"===e?this.chars=this.chars.toUpperCase():"lowercase"===e&&(this.chars=this.chars.toLowerCase())},i.prototype.removeDuplicates=function(){var e=this.chars.split("");e=n(e),this.chars=e.join("")},e.exports=i},function(e,t,r){"use strict";(function(t){var r;"Set"in t?"function"==typeof Set.prototype.forEach&&(r=!1,new Set([!0]).forEach((function(e){r=e})),!0===r)?e.exports=function(e){var t=[];return new Set(e).forEach((function(e){t.push(e)})),t}:e.exports=function(e){var t=new Set;return e.filter((function(e){if(!t.has(e))return t.add(e),!0}))}:e.exports=function(e){for(var t=[],r=0;r1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},l=function(e){var t=m(e,s.TAG_NAMES.TITLE),r=m(e,s.HELMET_PROPS.TITLE_TEMPLATE);if(r&&t)return r.replace(/%s/g,(function(){return t}));var n=m(e,s.HELMET_PROPS.DEFAULT_TITLE);return t||n||void 0},d=function(e){return m(e,s.HELMET_PROPS.ON_CHANGE_CLIENT_STATE)||function(){}},h=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return i({},e,t)}),{})},p=function(e,t){return t.filter((function(e){return void 0!==e[s.TAG_NAMES.BASE]})).map((function(e){return e[s.TAG_NAMES.BASE]})).reverse().reduce((function(t,r){if(!t.length)for(var n=Object.keys(r),i=0;i=0;r--){var n=e[r];if(n.hasOwnProperty(t))return n[t]}return null},y=(c=Date.now(),function(e){var t=Date.now();t-c>16?(c=t,e(t)):setTimeout((function(){y(e)}),0)}),v=function(e){return clearTimeout(e)},g="undefined"!=typeof window?window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||y:e.requestAnimationFrame||y,w="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||v:e.cancelAnimationFrame||v,_=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},E=null,S=function(e,t){var r=e.baseTag,n=e.bodyAttributes,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,u=e.noscriptTags,c=e.onChangeClientState,f=e.scriptTags,l=e.styleTags,d=e.title,h=e.titleAttributes;x(s.TAG_NAMES.BODY,n),x(s.TAG_NAMES.HTML,i),T(d,h);var p={baseTag:M(s.TAG_NAMES.BASE,r),linkTags:M(s.TAG_NAMES.LINK,o),metaTags:M(s.TAG_NAMES.META,a),noscriptTags:M(s.TAG_NAMES.NOSCRIPT,u),scriptTags:M(s.TAG_NAMES.SCRIPT,f),styleTags:M(s.TAG_NAMES.STYLE,l)},b={},m={};Object.keys(p).forEach((function(e){var t=p[e],r=t.newTags,n=t.oldTags;r.length&&(b[e]=r),n.length&&(m[e]=p[e].oldTags)})),t&&t(),c(e,b,m)},k=function(e){return Array.isArray(e)?e.join(""):e},T=function(e,t){void 0!==e&&document.title!==e&&(document.title=k(e)),x(s.TAG_NAMES.TITLE,t)},x=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute(s.HELMET_ATTRIBUTE),i=n?n.split(","):[],o=[].concat(i),a=Object.keys(t),u=0;u=0;d--)r.removeAttribute(o[d]);i.length===o.length?r.removeAttribute(s.HELMET_ATTRIBUTE):r.getAttribute(s.HELMET_ATTRIBUTE)!==a.join(",")&&r.setAttribute(s.HELMET_ATTRIBUTE,a.join(","))}},M=function(e,t){var r=document.head||document.querySelector(s.TAG_NAMES.HEAD),n=r.querySelectorAll(e+"["+s.HELMET_ATTRIBUTE+"]"),i=Array.prototype.slice.call(n),o=[],a=void 0;return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var n in t)if(t.hasOwnProperty(n))if(n===s.TAG_PROPERTIES.INNER_HTML)r.innerHTML=t.innerHTML;else if(n===s.TAG_PROPERTIES.CSS_TEXT)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{var u=void 0===t[n]?"":t[n];r.setAttribute(n,u)}r.setAttribute(s.HELMET_ATTRIBUTE,"true"),i.some((function(e,t){return a=t,r.isEqualNode(e)}))?i.splice(a,1):o.push(r)})),i.forEach((function(e){return e.parentNode.removeChild(e)})),o.forEach((function(e){return r.appendChild(e)})),{oldTags:i,newTags:o}},C=function(e){return Object.keys(e).reduce((function(t,r){var n=void 0!==e[r]?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n}),"")},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[s.REACT_TAG_MAP[r]||r]=e[r],t}),t)},P=function(e,t,r){switch(e){case s.TAG_NAMES.TITLE:return{toComponent:function(){return e=t.title,r=t.titleAttributes,(n={key:e})[s.HELMET_ATTRIBUTE]=!0,i=O(r,n),[o.default.createElement(s.TAG_NAMES.TITLE,i,e)];var e,r,n,i},toString:function(){return function(e,t,r,n){var i=C(r),o=k(t);return i?"<"+e+" "+s.HELMET_ATTRIBUTE+'="true" '+i+">"+f(o,n)+"":"<"+e+" "+s.HELMET_ATTRIBUTE+'="true">'+f(o,n)+""}(e,t.title,t.titleAttributes,r)}};case s.ATTRIBUTE_NAMES.BODY:case s.ATTRIBUTE_NAMES.HTML:return{toComponent:function(){return O(t)},toString:function(){return C(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,r){var n,i=((n={key:r})[s.HELMET_ATTRIBUTE]=!0,n);return Object.keys(t).forEach((function(e){var r=s.REACT_TAG_MAP[e]||e;if(r===s.TAG_PROPERTIES.INNER_HTML||r===s.TAG_PROPERTIES.CSS_TEXT){var n=t.innerHTML||t.cssText;i.dangerouslySetInnerHTML={__html:n}}else i[r]=t[e]})),o.default.createElement(e,i)}))}(e,t)},toString:function(){return function(e,t,r){return t.reduce((function(t,n){var i=Object.keys(n).filter((function(e){return!(e===s.TAG_PROPERTIES.INNER_HTML||e===s.TAG_PROPERTIES.CSS_TEXT)})).reduce((function(e,t){var i=void 0===n[t]?t:t+'="'+f(n[t],r)+'"';return e?e+" "+i:i}),""),o=n.innerHTML||n.cssText||"",a=-1===s.SELF_CLOSING_TAGS.indexOf(e);return t+"<"+e+" "+s.HELMET_ATTRIBUTE+'="true" '+i+(a?"/>":">"+o+"")}),"")}(e,t,r)}}}};t.convertReactPropstoHtmlAttributes=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[s.HTML_TAG_MAP[r]||r]=e[r],t}),t)},t.handleClientStateChange=function(e){E&&w(E),e.defer?E=g((function(){S(e,(function(){E=null}))})):(S(e),E=null)},t.mapStateOnServer=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,i=e.htmlAttributes,o=e.linkTags,a=e.metaTags,u=e.noscriptTags,c=e.scriptTags,f=e.styleTags,l=e.title,d=void 0===l?"":l,h=e.titleAttributes;return{base:P(s.TAG_NAMES.BASE,t,n),bodyAttributes:P(s.ATTRIBUTE_NAMES.BODY,r,n),htmlAttributes:P(s.ATTRIBUTE_NAMES.HTML,i,n),link:P(s.TAG_NAMES.LINK,o,n),meta:P(s.TAG_NAMES.META,a,n),noscript:P(s.TAG_NAMES.NOSCRIPT,u,n),script:P(s.TAG_NAMES.SCRIPT,c,n),style:P(s.TAG_NAMES.STYLE,f,n),title:P(s.TAG_NAMES.TITLE,{title:d,titleAttributes:h},n)}},t.reducePropsToState=function(e){return{baseTag:p([s.TAG_PROPERTIES.HREF],e),bodyAttributes:h(s.ATTRIBUTE_NAMES.BODY,e),defer:m(e,s.HELMET_PROPS.DEFER),encode:m(e,s.HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:h(s.ATTRIBUTE_NAMES.HTML,e),linkTags:b(s.TAG_NAMES.LINK,[s.TAG_PROPERTIES.REL,s.TAG_PROPERTIES.HREF],e),metaTags:b(s.TAG_NAMES.META,[s.TAG_PROPERTIES.NAME,s.TAG_PROPERTIES.CHARSET,s.TAG_PROPERTIES.HTTPEQUIV,s.TAG_PROPERTIES.PROPERTY,s.TAG_PROPERTIES.ITEM_PROP],e),noscriptTags:b(s.TAG_NAMES.NOSCRIPT,[s.TAG_PROPERTIES.INNER_HTML],e),onChangeClientState:d(e),scriptTags:b(s.TAG_NAMES.SCRIPT,[s.TAG_PROPERTIES.SRC,s.TAG_PROPERTIES.INNER_HTML],e),styleTags:b(s.TAG_NAMES.STYLE,[s.TAG_PROPERTIES.CSS_TEXT],e),title:l(e),titleAttributes:h(s.ATTRIBUTE_NAMES.TITLE,e)}},t.requestAnimationFrame=g,t.warn=_}).call(this,r(9))},function(e,t,r){"use strict";var n=r(10),i=r(119),o=r(254),a=r(125);function s(e){var t=new o(e),r=i(o.prototype.request,t);return n.extend(r,o.prototype,t),n.extend(r,t),r}var u=s(r(122));u.Axios=o,u.create=function(e){return s(a(u.defaults,e))},u.Cancel=r(126),u.CancelToken=r(266),u.isCancel=r(121),u.all=function(e){return Promise.all(e)},u.spread=r(267),e.exports=u,e.exports.default=u},function(e,t){ /*! * Determine if an object is a Buffer * diff --git a/react-shopping-cart-demo/public/assets/resources/data/latestProducts.json b/react-shopping-cart-demo/public/assets/resources/data/latestProducts.json index 5c828dd..9aad7b7 100644 --- a/react-shopping-cart-demo/public/assets/resources/data/latestProducts.json +++ b/react-shopping-cart-demo/public/assets/resources/data/latestProducts.json @@ -1 +1,34 @@ -[{"description":"This luxurious sweater will look great with everything from jeans to chinos, Classic fit, Cotton/polyester, Machine washable, Imported","id":1,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/poc.png","price":29.0,"title":"Danbury grey sweater with round buttons","userId":1},{"description":"Adjustable, foldable headband, Controls: Volume, play/pause, answers/end call, 2 years Warranty","id":5,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/headphone.png","price":45.0,"title":"DBeatz wireless headphones","userId":1},{"description":"Built for lightweight performance, Men's athletic footwear from Airz, Synthetic upper; rubber sole.","id":9,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/shoes.png","price":59.0,"title":"Airz Running Sneakers for men","userId":1},{"description":"Dress Watch from Euro Style, Round case, 44mm, Water resistance, Warranty: 3-year limited","id":12,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/watch.png","price":75,"title":"Men’s Black Stainless Steel Watch","userId":2}] \ No newline at end of file +[ + { + "description": "This luxurious sweater will look great with everything from jeans to chinos, Classic fit, Cotton/polyester, Machine washable, Imported", + "id": 1, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/poc.png", + "price": 29.0, + "title": "Danbury grey sweater with round buttons", + "userId": 1 + }, + { + "description": "Adjustable, foldable headband, Controls: Volume, play/pause, answers/end call, 2 years Warranty", + "id": 5, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/headphone.png", + "price": 45.0, + "title": "DBeatz wireless headphones", + "userId": 1 + }, + { + "description": "Built for lightweight performance, Men's athletic footwear from Airz, Synthetic upper; rubber sole.", + "id": 9, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/shoes.png", + "price": 59.0, + "title": "Airz Running Sneakers for men", + "userId": 1 + }, + { + "description": "Dress Watch from Euro Style, Round case, 44mm, Water resistance, Warranty: 3-year limited", + "id": 12, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/watch.png", + "price": 75, + "title": "Men’s Black Stainless Steel Watch", + "userId": 2 + } +] diff --git a/react-shopping-cart-demo/public/assets/resources/data/products.json b/react-shopping-cart-demo/public/assets/resources/data/products.json index 0ad4c59..c4bddcb 100644 --- a/react-shopping-cart-demo/public/assets/resources/data/products.json +++ b/react-shopping-cart-demo/public/assets/resources/data/products.json @@ -1 +1,98 @@ -[{"description":"This luxurious sweater will look great with everything from jeans to chinos, Classic fit, Cotton/polyester, Machine washable, Imported","id":1,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/poc.png","price":29.0,"title":"Danbury grey sweater with round buttons","userId":1},{"description":"Fashionable and functional medium size tote with a triple-compartment interior and plenty of pockets, Magnetic-snap closure, Gold-tone exterior hardware & logo charm, Imported","id":2,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/bag.jpeg","price":59.0,"title":"Cara black tote handbag ","userId":1},{"description":"Delicate flowers decorate this classic jean dress by Amore, Jean Pants – Pull on style, Machine Washable.","id":3,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/baby.png","price":30,"title":"Amore floral print dress and pants set","userId":1},{"description":"Spring inspired floral look, All cotton, Machine washable","id":4,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/floraldress.png","price":29.0,"title":"Short floral spring dress","userId":1},{"description":"Adjustable, foldable headband, Controls: Volume, play/pause, answers/end call, 2 years Warranty","id":5,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/headphone.png","price":45.0,"title":"DBeatz wireless headphones","userId":1},{"description":"Hardcase matte-finish plastic, striped polyester lining, 1 yr Warranty.","id":6,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/luggage.png","price":119.0,"title":"Voyage 3- piece luggage set","userId":1},{"description":"Rich botanicals helps hydrate sensitive skin and reduce appearance of fine lines and wrinkles.","id":7,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/moisturizer.png","price":99.0,"title":"Roselle age defying moisturizer","userId":1},{"description":"Fresh Floral Fragance with hints of Rose and Jasmine, Eau de Parfum Spray, 3.4 oz.","id":8,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/perfume.png","price":86,"title":"MADEMOISELLE collection for women","userId":1},{"description":"Built for lightweight performance, Men's athletic footwear from Airz, Synthetic upper; rubber sole.","id":9,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/shoes.png","price":59.0,"title":"Airz Running Sneakers for men","userId":1},{"description":"Ultra-soft and extra-absorbent, Imported, Mashine Washable","id":10,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/towels.png","price":19.0,"title":"Multi color Luxe Cotton Towels","userId":1},{"description":"Modern comfort long-sleeved cotton t-shirt, Machine Washable","id":11,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/tshirt.png","price":18.0,"title":"White AlfaMen Casual Tshirt","userId":2},{"description":"Dress Watch from Euro Style, Round case, 44mm, Water resistance, Warranty: 3-year limited","id":12,"image":"http://bennjose.businesscatalyst.com/images/reactreduxdemo/products/watch.png","price":75,"title":"Men’s Black Stainless Steel Watch","userId":2}] \ No newline at end of file +[ + { + "description": "This luxurious sweater will look great with everything from jeans to chinos, Classic fit, Cotton/polyester, Machine washable, Imported", + "id": 1, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/poc.png", + "price": 29.0, + "title": "Danbury grey sweater with round buttons", + "userId": 1 + }, + { + "description": "Fashionable and functional medium size tote with a triple-compartment interior and plenty of pockets, Magnetic-snap closure, Gold-tone exterior hardware & logo charm, Imported", + "id": 2, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/bag.jpeg", + "price": 59.0, + "title": "Cara black tote handbag ", + "userId": 1 + }, + { + "description": "Delicate flowers decorate this classic jean dress by Amore, Jean Pants – Pull on style, Machine Washable.", + "id": 3, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/baby.png", + "price": 30, + "title": "Amore floral print dress and pants set", + "userId": 1 + }, + { + "description": "Spring inspired floral look, All cotton, Machine washable", + "id": 4, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/floraldress.png", + "price": 29.0, + "title": "Short floral spring dress", + "userId": 1 + }, + { + "description": "Adjustable, foldable headband, Controls: Volume, play/pause, answers/end call, 2 years Warranty", + "id": 5, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/headphone.png", + "price": 45.0, + "title": "DBeatz wireless headphones", + "userId": 1 + }, + { + "description": "Hardcase matte-finish plastic, striped polyester lining, 1 yr Warranty.", + "id": 6, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/luggage.png", + "price": 119.0, + "title": "Voyage 3- piece luggage set", + "userId": 1 + }, + { + "description": "Rich botanicals helps hydrate sensitive skin and reduce appearance of fine lines and wrinkles.", + "id": 7, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/moisturizer.png", + "price": 99.0, + "title": "Roselle age defying moisturizer", + "userId": 1 + }, + { + "description": "Fresh Floral Fragance with hints of Rose and Jasmine, Eau de Parfum Spray, 3.4 oz.", + "id": 8, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/perfume.png", + "price": 86, + "title": "MADEMOISELLE collection for women", + "userId": 1 + }, + { + "description": "Built for lightweight performance, Men's athletic footwear from Airz, Synthetic upper; rubber sole.", + "id": 9, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/shoes.png", + "price": 59.0, + "title": "Airz Running Sneakers for men", + "userId": 1 + }, + { + "description": "Ultra-soft and extra-absorbent, Imported, Mashine Washable", + "id": 10, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/towels.png", + "price": 19.0, + "title": "Multi color Luxe Cotton Towels", + "userId": 1 + }, + { + "description": "Modern comfort long-sleeved cotton t-shirt, Machine Washable", + "id": 11, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/tshirt.png", + "price": 18.0, + "title": "White AlfaMen Casual Tshirt", + "userId": 2 + }, + { + "description": "Dress Watch from Euro Style, Round case, 44mm, Water resistance, Warranty: 3-year limited", + "id": 12, + "image": "https://cimage.adobe.com/acs/reactreduxdemo/products/watch.png", + "price": 75, + "title": "Men’s Black Stainless Steel Watch", + "userId": 2 + } +] diff --git a/react-shopping-cart-demo/public/at-odd.js b/react-shopping-cart-demo/public/at-odd.js new file mode 100644 index 0000000..3a7cbb1 --- /dev/null +++ b/react-shopping-cart-demo/public/at-odd.js @@ -0,0 +1,11449 @@ +/** + * @license + * at.js 2.6.1 | (c) Adobe Systems Incorporated | All rights reserved + * zepto.js | (c) 2010-2016 Thomas Fuchs | zeptojs.com/license +*/ +window.adobe = window.adobe || {}; +window.adobe.target = (function () { + 'use strict'; + + // This is used to make RequireJS happy + var define; + var _win = window; + var _doc = document; + var _isIE11OrModernBrowser = _doc.documentMode ? _doc.documentMode >= 11 : true; + var _isStandardMode = _doc.compatMode && _doc.compatMode === "CSS1Compat"; + + function isIE() { + var ua = window.navigator.userAgent; + var ie10orOlder = ua.indexOf("MSIE ") > 0; + var ie11 = ua.indexOf("Trident/") > 0; + + return ie10orOlder || ie11; + } + + var _isEnabled = _isStandardMode && _isIE11OrModernBrowser && !isIE(); + var _globalSettings = _win.targetGlobalSettings; + + if (!_isEnabled || (_globalSettings && _globalSettings.enabled === false)) { + _win.adobe = _win.adobe || {}; + _win.adobe.target = { + VERSION: "", + event: {}, + getOffer: noop, + getOffers: noopPromise, + applyOffer: noop, + applyOffers: noopPromise, + sendNotifications: noopPromise, + trackEvent: noop, + triggerView: noop, + registerExtension: noop, + init: noop + }; + _win.mboxCreate = noop; + _win.mboxDefine = noop; + _win.mboxUpdate = noop; + + if ("console" in _win && "warn" in _win.console) { + _win.console.warn( + "AT: Adobe Target content delivery is disabled. Update your DOCTYPE to support Standards mode." + ); + } + + return _win.adobe.target; + } + + + const ARTIFACT_DOWNLOAD_SUCCEEDED = "artifactDownloadSucceeded"; + const ARTIFACT_DOWNLOAD_FAILED = "artifactDownloadFailed"; + const GEO_LOCATION_UPDATED = "geoLocationUpdated"; + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String('abc'); + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + return true; + } catch (err) { + return false; + } + } + var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + return to; + }; + + var reactorObjectAssign = objectAssign; + + function isNil(value) { + return value == null; + } + + const { + isArray + } = Array; + + const { + prototype: objectProto + } = Object; + const { + toString: nativeObjectToString + } = objectProto; + function objectToString(value) { + return nativeObjectToString.call(value); + } + function baseGetTag(value) { + return objectToString(value); + } + + function isObject(value) { + const type = typeof value; + const notNull = value != null; + return notNull && (type === "object" || type === "function"); + } + + const funcTag = "[object Function]"; + function isFunction(value) { + if (!isObject(value)) { + return false; + } + return baseGetTag(value) === funcTag; + } + + function identity(value) { + return value; + } + + function castFunction(value) { + return isFunction(value) ? value : identity; + } + + function keys(object) { + if (isNil(object)) { + return []; + } + return Object.keys(object); + } + + const arrayEach = (iteratee, collection) => collection.forEach(iteratee); + + const baseEach = (iteratee, collection) => { + arrayEach(key => iteratee(collection[key], key), keys(collection)); + }; + + const arrayFilter = (predicate, collection) => collection.filter(predicate); + const baseFilter = (predicate, collection) => { + const result = {}; + baseEach((value, key) => { + if (predicate(value, key)) { + result[key] = value; + } + }, collection); + return result; + }; + function filter(predicate, collection) { + if (isNil(collection)) { + return []; + } + const func = isArray(collection) ? arrayFilter : baseFilter; + return func(castFunction(predicate), collection); + } + + function first(array) { + return array && array.length ? array[0] : undefined; + } + + function flatten(array) { + if (isNil(array)) { + return []; + } + return [].concat.apply([], array); + } + + function flow(funcs) { + const length = funcs ? funcs.length : 0; + let index = length; + while (index -= 1) { + if (!isFunction(funcs[index])) { + throw new TypeError("Expected a function"); + } + } + return (...args) => { + let i = 0; + let result = length ? funcs[i].apply(this, args) : args[0]; + while ((i += 1) < length) { + result = funcs[i].call(this, result); + } + return result; + }; + } + + function forEach(iteratee, collection) { + if (isNil(collection)) { + return; + } + const func = isArray(collection) ? arrayEach : baseEach; + func(castFunction(iteratee), collection); + } + + function isObjectLike(value) { + const notNull = value != null; + return notNull && typeof value === "object"; + } + + const stringTag = "[object String]"; + function isString(value) { + return typeof value === "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) === stringTag; + } + + function hash(string) { + if (!isString(string)) { + return -1; + } + let result = 0; + const { + length + } = string; + for (let i = 0; i < length; i += 1) { + result = (result << 5) - result + string.charCodeAt(i) & 0xffffffff; + } + return result; + } + + const MAX_SAFE_INTEGER = 9007199254740991; + function isLength(value) { + return typeof value === "number" && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; + } + + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + const arrayMap = (iteratee, collection) => collection.map(iteratee); + + function baseValues(props, object) { + return arrayMap(key => object[key], props); + } + function copyArray(source) { + let index = 0; + const { + length + } = source; + const array = Array(length); + while (index < length) { + array[index] = source[index]; + index += 1; + } + return array; + } + function stringToArray(str) { + return str.split(""); + } + function toArray(value) { + if (isNil(value)) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + return baseValues(keys(value), value); + } + + function includes(value, collection) { + const coll = isArrayLike(collection) ? collection : toArray(collection); + return coll.indexOf(value) > -1; + } + + const { + prototype: objectProto$1 + } = Object; + const { + hasOwnProperty: hasOwnProperty$1 + } = objectProto$1; + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && (isArray(value) || isString(value) || isFunction(value.splice))) { + return !value.length; + } + for (const key in value) { + if (hasOwnProperty$1.call(value, key)) { + return false; + } + } + return true; + } + + const { + prototype: stringProto + } = String; + const { + trim: nativeStringTrim + } = stringProto; + function trim(string) { + return isNil(string) ? "" : nativeStringTrim.call(string); + } + + function isBlank(value) { + return isString(value) ? !trim(value) : isEmpty(value); + } + + const isNotBlank = value => !isBlank(value); + + const numberTag = "[object Number]"; + function isNumber(value) { + return typeof value === "number" || isObjectLike(value) && baseGetTag(value) === numberTag; + } + + const objectTag = "[object Object]"; + const { + prototype: funcProto + } = Function; + const { + prototype: objectProto$2 + } = Object; + const { + toString: funcToString + } = funcProto; + const { + hasOwnProperty: hasOwnProperty$2 + } = objectProto$2; + const objectCtorString = funcToString.call(Object); + function getPrototype(value) { + return Object.getPrototypeOf(Object(value)); + } + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + + function join(joiner, collection) { + if (!isArray(collection)) { + return ""; + } + return collection.join(joiner || ""); + } + + const baseMap = (iteratee, collection) => { + const result = {}; + baseEach((value, key) => { + result[key] = iteratee(value, key); + }, collection); + return result; + }; + function map(iteratee, collection) { + if (isNil(collection)) { + return []; + } + const func = isArray(collection) ? arrayMap : baseMap; + return func(castFunction(iteratee), collection); + } + + function now() { + return new Date().getTime(); + } + + const arrayReduce = (iteratee, accumulator, collection) => collection.reduce(iteratee, accumulator); + const baseReduce = (iteratee, accumulator, collection) => { + let localAcc = accumulator; + baseEach((value, key) => { + localAcc = iteratee(localAcc, value, key); + }, collection); + return localAcc; + }; + function reduce(iteratee, accumulator, collection) { + if (isNil(collection)) { + return accumulator; + } + const func = isArray(collection) ? arrayReduce : baseReduce; + return func(castFunction(iteratee), accumulator, collection); + } + + const { + prototype: arrayProto + } = Array; + const { + reverse: nativeReverse + } = arrayProto; + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + function split(separator, string) { + if (isBlank(string)) { + return []; + } + return string.split(separator || ""); + } + + function random(lower, upper) { + return lower + Math.floor(Math.random() * (upper - lower + 1)); + } + function uuid() { + let d = now(); + return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, c => { + const r = (d + random(0, 16)) % 16 | 0; + d = Math.floor(d / 16); + return (c === "x" ? r : r & 0x3 | 0x8).toString(16); + }); + } + + function values(obj) { + if (obj === null || typeof obj !== "object") { + return []; + } + return Object.keys(obj).map(key => obj[key]); + } + + function delay(func, wait = 0) { + return setTimeout(func, Number(wait) || 0); + } + function cancelDelay(id) { + clearTimeout(id); + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } + + const DECISIONING_METHOD = { + ON_DEVICE: "on-device", + SERVER_SIDE: "server-side", + HYBRID: "hybrid" + }; + + const AT_PREFIX = "AT:"; + const NOOP_LOGGER = { + debug(...messages) {}, + error(...messages) {} + }; + function getLogger(logger = {}) { + if (logger.built) { + return logger; + } + const { + debug, + error + } = logger; + const targetLogger = reactorObjectAssign({ + built: true + }, NOOP_LOGGER); + if (isFunction(debug)) { + targetLogger.debug = (...messages) => { + logger.debug.apply(null, [AT_PREFIX, ...messages]); + }; + } + if (isFunction(error)) { + targetLogger.error = (...messages) => { + logger.error.apply(null, [AT_PREFIX, ...messages]); + }; + } + return targetLogger; + } + + const DECISIONING_ENGINE_NOT_READY = "Unable to fulfill request; decisioning engine not ready."; + + const DEFAULT_GLOBAL_MBOX = "target-global-mbox"; + const DEFAULT_NUM_FETCH_RETRIES = 10; + const ChannelType = { + Mobile: "mobile", + Web: "web" + }; + const MetricType = { + Click: "click", + Display: "display" + }; + const AuthenticatedState = { + Unknown: "unknown", + Authenticated: "authenticated", + LoggedOut: "logged_out" + }; + const ENVIRONMENT_PROD = "production"; + const ENVIRONMENT_STAGE = "staging"; + const ENVIRONMENT_DEV = "development"; + const POSSIBLE_ENVIRONMENTS = [ENVIRONMENT_PROD, ENVIRONMENT_STAGE, ENVIRONMENT_DEV]; + const UNKNOWN_IP_ADDRESS = "unknownIpAddress"; + + const VIEWS = "views"; + const MBOXES = "mboxes"; + function isUndefined(value) { + return typeof value === "undefined"; + } + function isDefined(value) { + return !isUndefined(value); + } + function getNamesForRequested(itemsKey, deliveryRequest) { + const resultSet = new Set(); + ["prefetch", "execute"].forEach(type => { + const items = deliveryRequest && deliveryRequest[type] && deliveryRequest[type][itemsKey] instanceof Array ? deliveryRequest[type][itemsKey] : []; + items.filter(item => isDefined(item.name)).forEach(item => { + resultSet.add(item.name); + }); + }); + return resultSet; + } + function getMboxNames(deliveryRequest) { + return getNamesForRequested(MBOXES, deliveryRequest); + } + function getViewNames(deliveryRequest) { + return getNamesForRequested(VIEWS, deliveryRequest); + } + function hasRequested(itemsKey, deliveryRequest) { + const types = ["prefetch", "execute"]; + for (let i = 0; i < types.length; i += 1) { + const type = types[i]; + const items = deliveryRequest && deliveryRequest[type] && deliveryRequest[type][itemsKey] instanceof Array ? deliveryRequest[type][itemsKey] : undefined; + if (isDefined(items) && items instanceof Array) { + return true; + } + } + return false; + } + function hasRequestedViews(deliveryRequest) { + return hasRequested(VIEWS, deliveryRequest); + } + function isBrowser() { + return typeof window !== "undefined"; + } + function isNodeJS() { + return typeof global !== "undefined"; + } + const noop = () => undefined; + const noopPromise = value => Promise.resolve(value); + function requiresDecisioningEngine(decisioningMethod) { + return includes(decisioningMethod, [DECISIONING_METHOD.ON_DEVICE, DECISIONING_METHOD.HYBRID]); + } + function objectWithoutUndefinedValues(obj) { + const result = _objectSpread2({}, obj); + Object.keys(result).forEach(key => { + if (isUndefined(result[key])) { + delete result[key]; + } + }); + return result; + } + function getPropertyToken(property = { + token: undefined + }) { + const { + token = undefined + } = property; + return token; + } + function isValidIpAddress(ipAddress) { + const IP_ADDRESS = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/g; + return isString(ipAddress) && IP_ADDRESS.test(ipAddress); + } + function memoize(func, keyResolverFunc = arr => arr[0]) { + const memoizedValues = {}; + return function memoized(...funcArgs) { + const key = keyResolverFunc.call(this, funcArgs); + if (!isDefined(memoizedValues[key])) { + memoizedValues[key] = func.call(null, ...funcArgs); + } + return memoizedValues[key]; + }; + } + + const NOT_MODIFIED = 304; + function getFetchApi(fetchApi) { + if (isFunction(fetchApi)) { + return fetchApi; + } + let api; + if (isNodeJS() && typeof global.fetch === "function") { + api = global.fetch; + } else if (isBrowser() && + typeof window.fetch === "function") { + api = window.fetch.bind(window); + } + return api; + } + function getFetchWithRetry(fetchApi, maxRetries = DEFAULT_NUM_FETCH_RETRIES, errorFunc = errorMessage => errorMessage, incidentalFailureCallback = noop) { + return function fetchWithRetry(url, options, numRetries = maxRetries) { + return fetchApi(url, options).then(res => { + if (!res.ok && res.status !== NOT_MODIFIED) { + throw Error(res.statusText); + } + return res; + })['catch'](err => { + if (isFunction(incidentalFailureCallback)) { + incidentalFailureCallback.call(undefined, err); + } + if (numRetries < 1) { + throw new Error(errorFunc(err.message)); + } + return fetchWithRetry(url, options, numRetries - 1); + }); + }; + } + + function matchUserAgent(matchersList, processFunc) { + processFunc = typeof processFunc === "function" ? processFunc : matcher => matcher.name; + return function checkMatches(userAgent) { + for (let i = 0; i < matchersList.length; i += 1) { + const matcher = matchersList[i]; + const matches = userAgent.match(matcher.regex); + if (matches) { + return processFunc(matcher, matches); + } + } + return processFunc({ + name: "Unknown" + }); + }; + } + const browserFromUserAgent = (userAgent = "") => matchUserAgent([{ + name: "Edge", + regex: /(edge|edgios|edga|edg)\/((\d+)?[\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "Mobile Safari", + regex: /version\/([\w.]+).+?mobile\/\w+\s(safari)/i, + versionGroupIndex: 1 + }, { + name: "Safari", + regex: /version\/([\w.]+).+?(mobile\s?safari|safari)/i, + versionGroupIndex: 1 + }, { + name: "Chrome", + regex: /(chrome)\/v?([\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "Firefox", + regex: /(firefox)\/([\w.-]+)$/i, + versionGroupIndex: 2 + }, { + name: "IE", + regex: /(?:ms|\()(ie)\s([\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "IE", + regex: /(trident).+rv[:\s]([\w.]+).+like\sgecko/i, + versionGroupIndex: 2, + version: 11 + }], (matcher, matches) => { + const version = (matches && matches.length > matcher.versionGroupIndex ? matches[matcher.versionGroupIndex] : matcher.version) || "-1"; + const majorVersion = typeof version === "string" ? parseInt(version.split(".")[0], 10) : -1; + return { + name: matcher.name, + version: majorVersion + }; + })(userAgent); + const operatingSystemFromUserAgent = userAgent => matchUserAgent([{ + name: "iOS", + regex: /iPhone|iPad|iPod/ + }, { + name: "Android", + regex: /Android [0-9.]+;/ + }, { + name: "Linux", + regex: / Linux / + }, { + name: "Unix", + regex: /FreeBSD|OpenBSD|CrOS/ + }, { + name: "Windows", + regex: /[( ]Windows / + }, { + name: "Mac OS", + regex: /Macintosh;/ + }])(userAgent); + + function mul32(m, n) { + const nlo = n & 0xffff; + const nhi = n - nlo; + return (nhi * m | 0) + (nlo * m | 0) | 0; + } + function hashUnencodedCharsRaw(stringValue, seed = 0) { + let k1; + const len = stringValue.length; + const c1 = 0xcc9e2d51; + const c2 = 0x1b873593; + let h1 = seed; + const roundedEnd = len & ~0x1; + for (let i = 0; i < roundedEnd; i += 2) { + k1 = stringValue.charCodeAt(i) | stringValue.charCodeAt(i + 1) << 16; + k1 = mul32(k1, c1); + k1 = (k1 & 0x1ffff) << 15 | k1 >>> 17; + k1 = mul32(k1, c2); + h1 ^= k1; + h1 = (h1 & 0x7ffff) << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64 | 0; + } + if (len % 2 === 1) { + k1 = stringValue.charCodeAt(roundedEnd); + k1 = mul32(k1, c1); + k1 = (k1 & 0x1ffff) << 15 | k1 >>> 17; + k1 = mul32(k1, c2); + h1 ^= k1; + } + h1 ^= len << 1; + h1 ^= h1 >>> 16; + h1 = mul32(h1, 0x85ebca6b); + h1 ^= h1 >>> 13; + h1 = mul32(h1, 0xc2b2ae35); + h1 ^= h1 >>> 16; + return h1; + } + const hashUnencodedChars = memoize(hashUnencodedCharsRaw, arr => arr.join("-")); + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + + var performanceNow = createCommonjsModule(function (module) { + (function () { + var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; + if (typeof performance !== "undefined" && performance !== null && performance.now) { + module.exports = function () { + return performance.now(); + }; + } else if (typeof process !== "undefined" && process !== null && process.hrtime) { + module.exports = function () { + return (getNanoSeconds() - nodeLoadTime) / 1e6; + }; + hrtime = process.hrtime; + getNanoSeconds = function () { + var hr; + hr = hrtime(); + return hr[0] * 1e9 + hr[1]; + }; + moduleLoadTime = getNanoSeconds(); + upTime = process.uptime() * 1e9; + nodeLoadTime = moduleLoadTime - upTime; + } else if (Date.now) { + module.exports = function () { + return Date.now() - loadTime; + }; + loadTime = Date.now(); + } else { + module.exports = function () { + return new Date().getTime() - loadTime; + }; + loadTime = new Date().getTime(); + } + }).call(commonjsGlobal); + }); + + function createPerfToolInstance() { + let timingIds = {}; + let startTimes = {}; + let timings = {}; + function getUniqueTimingId(id) { + const count = (isDefined(timingIds[id]) ? timingIds[id] : 0) + 1; + timingIds[id] = count; + return "" + id + count; + } + function timeStart(id, incrementTimer = false) { + const timingId = incrementTimer ? getUniqueTimingId(id) : id; + if (isUndefined(startTimes[timingId])) { + startTimes[timingId] = performanceNow(); + } + return timingId; + } + function timeEnd(id, offset = 0) { + if (isUndefined(startTimes[id])) { + return -1; + } + const timing = performanceNow() - startTimes[id] - offset; + timings[id] = timing; + return timing; + } + function reset() { + timingIds = {}; + startTimes = {}; + timings = {}; + } + return { + timeStart, + timeEnd, + getTimings: () => timings, + getTiming: key => timings[key], + reset + }; + } + const perfTool = createPerfToolInstance(); + + function parseURI(str, opts) { + if (!str) return undefined; + opts = opts || {}; + var o = { + key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'], + q: { + name: 'queryKey', + parser: /(?:^|&)([^&=]*)=?([^&]*)/g + }, + parser: { + strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, + loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ + } + }; + var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str); + var uri = {}; + var i = 14; + while (i--) uri[o.key[i]] = m[i] || ''; + uri[o.q.name] = {}; + uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { + if ($1) uri[o.q.name][$1] = $2; + }); + return uri; + } + var parseUri = parseURI; + + const TYPE = "type"; + const CONTENT = "content"; + const HEIGHT = "height"; + const WIDTH = "width"; + const LEFT = "left"; + const TOP = "top"; + const FROM = "from"; + const TO = "to"; + const PRIORITY = "priority"; + const SELECTOR = "selector"; + const CSS_SELECTOR = "cssSelector"; + const SET_HTML = "setHtml"; + const SET_CONTENT = "setContent"; + const SET_TEXT = "setText"; + const SET_JSON = "setJson"; + const SET_ATTRIBUTE = "setAttribute"; + const SET_IMAGE_SOURCE = "setImageSource"; + const SET_STYLE = "setStyle"; + const REARRANGE = "rearrange"; + const RESIZE = "resize"; + const MOVE = "move"; + const REMOVE = "remove"; + const CUSTOM_CODE = "customCode"; + const REDIRECT = "redirect"; + const TRACK_CLICK = "trackClick"; + const SIGNAL_CLICK = "signalClick"; + const INSERT_BEFORE = "insertBefore"; + const INSERT_AFTER = "insertAfter"; + const APPEND_HTML = "appendHtml"; + const APPEND_CONTENT = "appendContent"; + const PREPEND_HTML = "prependHtml"; + const PREPEND_CONTENT = "prependContent"; + const REPLACE_HTML = "replaceHtml"; + const REPLACE_CONTENT = "replaceContent"; + const DEBUG = "mboxDebug"; + const DISABLE = "mboxDisable"; + const AUTHORING = "mboxEdit"; + const CHECK = "at_check"; + const TRUE = "true"; + const MBOX_LENGTH = 250; + const DATA_SRC = "data-at-src"; + const JSON$1 = "json"; + const HTML = "html"; + const DYNAMIC = "dynamic"; + const SCRIPT = "script"; + const SRC = "src"; + const ID = "id"; + const CLASS = "class"; + const CLICK = "click"; + const HEAD_TAG = "head"; + const SCRIPT_TAG = "script"; + const STYLE_TAG = "style"; + const LINK_TAG = "link"; + const IMAGE_TAG = "img"; + const DIV_TAG = "div"; + const NO_CACHED_ARTIFACT = "No cached artifact available for Hybrid mode."; + const DELIVERY_DISABLED = 'Adobe Target content delivery is disabled. Ensure that you can save cookies to your current domain, there is no "mboxDisable" cookie and there is no "mboxDisable" parameter in query string.'; + const ALREADY_INITIALIZED = "Adobe Target has already been initialized."; + const OPTIONS_REQUIRED = "options argument is required"; + const REQUEST_REQUIRED = "request option is required"; + const RESPONE_REQUIRED = "response option is required"; + const EXECUTE_OR_PREFETCH_REQUIRED = "execute or prefetch is required"; + const EXECUTE_OR_PREFETCH_NOT_ALLOWED = "execute or prefetch is not allowed"; + const NOTIFICATIONS_REQUIRED = "notifications are required"; + const MBOX_REQUIRED = "mbox option is required"; + const MBOX_TOO_LONG = "mbox option is too long"; + const SUCCESS_REQUIRED = "success option is required"; + const ERROR_REQUIRED = "error option is required"; + const OFFER_REQUIRED = "offer option is required"; + const UNEXPECTED_ERROR = "Unexpected error"; + const REQUEST_FAILED = "request failed"; + const REQUEST_SUCCEEDED = "request succeeded"; + const ACTION_RENDERED = "Action rendered successfully"; + const ACTION_RENDERING = "Rendering action"; + const EMPTY_CONTENT = "Action has no content"; + const EMPTY_ATTRIBUTE = "Action has no attributes"; + const EMPTY_PROPERTY = "Action has no CSS properties"; + const EMPTY_SIZES = "Action has no height or width"; + const EMPTY_COORDINATES = "Action has no left, top or position"; + const EMPTY_REARRANGE = "Action has no from or to"; + const EMPTY_URL = "Action has no url"; + const EMPTY_IMAGE_URL = "Action has no image url"; + const REARRANGE_MISSING = "Rearrange elements are missing"; + const REARRANGE_INCORRECT_INDEXES = "Rearrange has incorrect \"from\" and \"to\" indexes"; + const LOADING_IMAGE = "Loading image"; + const TRACK_EVENT_SUCCESS = "Track event request succeeded"; + const TRACK_EVENT_ERROR = "Track event request failed"; + const NO_ACTIONS = "No actions to be rendered"; + const REDIRECT_ACTION = "Redirect action"; + const REMOTE_SCRIPT = "Script load"; + const ERROR = "error"; + const WARNING = "warning"; + const UNKNOWN = "unknown"; + const VALID = "valid"; + const SUCCESS = "success"; + const RENDER = "render"; + const METRIC = "metric"; + const MBOX = "mbox"; + const OFFER = "offer"; + const NAME = "name"; + const STATUS = "status"; + const PARAMS = "params"; + const ACTIONS = "actions"; + const RESPONSE_TOKENS = "responseTokens"; + const DATA = "data"; + const RESPONSE = "response"; + const REQUEST = "request"; + const PROVIDER = "provider"; + const PAGE_LOAD = "pageLoad"; + const FLICKER_CONTROL_CLASS = "at-flicker-control"; + const MARKER_CSS_CLASS = "at-element-marker"; + const CLICK_TRACKING_CSS_CLASS = "at-element-click-tracking"; + const ENABLED = "enabled"; + const CLIENT_CODE = "clientCode"; + const IMS_ORG_ID = "imsOrgId"; + const SERVER_DOMAIN = "serverDomain"; + const TIMEOUT = "timeout"; + const GLOBAL_MBOX_NAME = "globalMboxName"; + const GLOBAL_MBOX_AUTO_CREATE = "globalMboxAutoCreate"; + const VERSION = "version"; + const DEFAULT_CONTENT_HIDDEN_STYLE = "defaultContentHiddenStyle"; + const DEFAULT_CONTENT_VISIBLE_STYLE = "defaultContentVisibleStyle"; + const BODY_HIDDEN_STYLE = "bodyHiddenStyle"; + const BODY_HIDING_ENABLED = "bodyHidingEnabled"; + const DEVICE_ID_LIFETIME = "deviceIdLifetime"; + const SESSION_ID_LIFETIME = "sessionIdLifetime"; + const SELECTORS_POLLING_TIMEOUT = "selectorsPollingTimeout"; + const VISITOR_API_TIMEOUT = "visitorApiTimeout"; + const OVERRIDE_MBOX_EDGE_SERVER = "overrideMboxEdgeServer"; + const OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT = "overrideMboxEdgeServerTimeout"; + const OPTOUT_ENABLED = "optoutEnabled"; + const SECURE_ONLY = "secureOnly"; + const SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT = "supplementalDataIdParamTimeout"; + const AUTHORING_SCRIPT_URL = "authoringScriptUrl"; + const SCHEME = "scheme"; + const COOKIE_DOMAIN = "cookieDomain"; + const MBOX_PARAMS = "mboxParams"; + const GLOBAL_MBOX_PARAMS = "globalMboxParams"; + const URL_SIZE_LIMIT = "urlSizeLimit"; + const SESSION_ID_PARAM = "mboxSession"; + const DEVICE_ID_COOKIE = "PC"; + const EDGE_CLUSTER_COOKIE = "mboxEdgeCluster"; + const SESSION_ID_COOKIE = "session"; + const GEO_COOKIE = "at_geo"; + const TRACES_SUFFIX = "Traces"; + const SETTINGS = "settings"; + const CLIENT_TRACES = "client" + TRACES_SUFFIX; + const SERVER_TRACES = "server" + TRACES_SUFFIX; + const TRACES = "___target_traces"; + const GLOBAL_SETTINGS = "targetGlobalSettings"; + const DATA_PROVIDER = "dataProvider"; + const DATA_PROVIDERS = DATA_PROVIDER + "s"; + const ENDPOINT = "endpoint"; + const VIEWS_ENABLED = "viewsEnabled"; + const PAGE_LOAD_ENABLED = "pageLoadEnabled"; + const AUTH_STATE = "authState"; + const AUTHENTICATED_STATE = "authenticatedState"; + const INTEGRATION_CODE = "integrationCode"; + const PRIMARY = "primary"; + const PAGE = "page"; + const VIEW = "view"; + const VIEWS$1 = "views"; + const OPTIONS = "options"; + const METRICS = "metrics"; + const EVENT_TOKEN = "eventToken"; + const VIEW_NAME = "viewName"; + const DISPLAY_EVENT = "display"; + const CONTENT_TYPE = "Content-Type"; + const TEXT_PLAIN = "text/plain"; + const RENDERING_VIEW_FAILED = "View rendering failed"; + const VIEW_DELIVERY_ERROR = "View delivery error"; + const VIEW_NAME_ERROR = "View name should be a non-empty string"; + const VIEWS_DISABLED = "Views are not enabled"; + const PAGE_LOAD_DISABLED = "Page load disabled"; + const USING_SERVER_STATE = "Using server state"; + const ADOBE = "adobe"; + const OPTIN = "optIn"; + const IS_APPROVED = "isApproved"; + const FETCH_PERMISSIONS = "fetchPermissions"; + const CATEGORIES = "Categories"; + const TARGET = "TARGET"; + const ANALYTICS = "ANALYTICS"; + const OPTIN_ENABLED = "optinEnabled"; + const ERROR_TARGET_NOT_OPTED_IN = "Adobe Target is not opted in"; + const ANALYTICS_LOGGING = "analyticsLogging"; + const SERVER_STATE = "serverState"; + const CSP_SCRIPT_NONCE = "cspScriptNonce"; + const CSP_STYLE_NONCE = "cspStyleNonce"; + const CACHE_UPDATED_EVENT = "cache-updated-event"; + const NO_OFFERS_EVENT = "no-offers-event"; + const REDIRECT_OFFER_EVENT = "redirect-offer-event"; + const SAMESITE_NONE = "None"; + const DECISIONING_METHOD_SETTING = "decisioningMethod"; + const POLLING_INTERVAL_SETTING = "pollingInterval"; + const ARTIFACT_LOCATION_SETTING = "artifactLocation"; + const ARTIFACT_FORMAT_SETTING = "artifactFormat"; + const ARTIFACT_PAYLOAD_SETTING = "artifactPayload"; + const TARGET_ENVIRONMENT_SETTING = "environment"; + const CDN_ENVIRONMENT_SETTING = "cdnEnvironment"; + const TELEMETRY_ENABLED_SETTING = "telemetryEnabled"; + const CDN_BASEPATH_SETTING = "cdnBasePath"; + const WEB_CHANNEL = "web"; + + const FILE_PROTOCOL = "file:"; + const IP_V4_REGEX = /^(?!0)(?!.*\.$)((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$/; + const STANDARD_DOMAIN_REGEX = /^(com|edu|gov|net|mil|org|nom|co|name|info|biz)$/i; + let config = {}; + const OVERRIDABLE_SETTINGS = [ENABLED, CLIENT_CODE, IMS_ORG_ID, SERVER_DOMAIN, COOKIE_DOMAIN, TIMEOUT, MBOX_PARAMS, GLOBAL_MBOX_PARAMS, DEFAULT_CONTENT_HIDDEN_STYLE, DEFAULT_CONTENT_VISIBLE_STYLE, DEVICE_ID_LIFETIME, BODY_HIDDEN_STYLE, BODY_HIDING_ENABLED, SELECTORS_POLLING_TIMEOUT, VISITOR_API_TIMEOUT, OVERRIDE_MBOX_EDGE_SERVER, OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT, OPTOUT_ENABLED, OPTIN_ENABLED, SECURE_ONLY, SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT, AUTHORING_SCRIPT_URL, URL_SIZE_LIMIT, ENDPOINT, PAGE_LOAD_ENABLED, VIEWS_ENABLED, ANALYTICS_LOGGING, SERVER_STATE, DECISIONING_METHOD_SETTING, POLLING_INTERVAL_SETTING, ARTIFACT_LOCATION_SETTING, ARTIFACT_FORMAT_SETTING, ARTIFACT_PAYLOAD_SETTING, TARGET_ENVIRONMENT_SETTING, CDN_ENVIRONMENT_SETTING, TELEMETRY_ENABLED_SETTING, CDN_BASEPATH_SETTING, CSP_SCRIPT_NONCE, CSP_STYLE_NONCE, GLOBAL_MBOX_NAME]; + function overrideSettingsIfRequired(settings, globalSettings) { + if (!settings[ENABLED]) { + return; + } + if (!isNil(globalSettings[GLOBAL_MBOX_AUTO_CREATE])) { + settings[PAGE_LOAD_ENABLED] = globalSettings[GLOBAL_MBOX_AUTO_CREATE]; + } + forEach(field => { + if (!isNil(globalSettings[field])) { + settings[field] = globalSettings[field]; + } + }, OVERRIDABLE_SETTINGS); + } + function isIE10OrModernBrowser(doc) { + const { + documentMode + } = doc; + return documentMode ? documentMode >= 10 : true; + } + function isStandardMode(doc) { + const { + compatMode + } = doc; + return compatMode && compatMode === "CSS1Compat"; + } + function isIPv4(domain) { + return IP_V4_REGEX.test(domain); + } + function getCookieDomain(domain) { + if (isIPv4(domain)) { + return domain; + } + const parts = reverse(split(".", domain)); + const len = parts.length; + if (len >= 3) { + if (STANDARD_DOMAIN_REGEX.test(parts[1])) { + return parts[2] + "." + parts[1] + "." + parts[0]; + } + } + if (len === 1) { + return parts[0]; + } + return parts[1] + "." + parts[0]; + } + function overrideFromGlobalSettings(win, doc, settings) { + const fileProtocol = win.location.protocol === FILE_PROTOCOL; + let cookieDomain = ""; + if (!fileProtocol) { + cookieDomain = getCookieDomain(win.location.hostname); + } + settings[COOKIE_DOMAIN] = cookieDomain; + settings[ENABLED] = isStandardMode(doc) && isIE10OrModernBrowser(doc); + overrideSettingsIfRequired(settings, win[GLOBAL_SETTINGS] || {}); + } + function initConfig(settings) { + overrideFromGlobalSettings(window, document, settings); + const fileProtocol = window.location.protocol === FILE_PROTOCOL; + config = reactorObjectAssign({}, settings); + config[DEVICE_ID_LIFETIME] = settings[DEVICE_ID_LIFETIME] / 1000; + config[SESSION_ID_LIFETIME] = settings[SESSION_ID_LIFETIME] / 1000; + config[SCHEME] = config[SECURE_ONLY] || fileProtocol ? "https:" : ""; + } + function getConfig() { + return config; + } + + var js_cookie = createCommonjsModule(function (module, exports) { + (function (factory) { + var registeredInModuleLoader; + { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } + })(function () { + function extend() { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[i]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + function decode(s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + function init(converter) { + function api() {} + function set(key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + attributes = extend({ + path: '/' + }, api.defaults, attributes); + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + return document.cookie = key + '=' + value + stringifiedAttributes; + } + function get(key, json) { + if (typeof document === 'undefined') { + return; + } + var jar = {}; + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || decode(cookie); + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + jar[name] = cookie; + if (key === name) { + break; + } + } catch (e) {} + } + return key ? jar[key] : jar; + } + api.set = set; + api.get = function (key) { + return get(key, false + ); + }; + api.getJSON = function (key) { + return get(key, true + ); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + api.defaults = {}; + api.withConverter = init; + return api; + } + return init(function () {}); + }); + }); + + var reactorCookie = { + get: js_cookie.get, + set: js_cookie.set, + remove: js_cookie.remove + }; + + function hasOwnProperty$3(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + var decode = function (qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + var regexp = /\+/g; + qs = qs.split(sep); + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + var len = qs.length; + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, + vstr, + k, + v; + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + if (!hasOwnProperty$3(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + return obj; + }; + + var stringifyPrimitive = function (v) { + switch (typeof v) { + case 'string': + return v; + case 'boolean': + return v ? 'true' : 'false'; + case 'number': + return isFinite(v) ? v : ''; + default: + return ''; + } + }; + var encode = function (obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + if (typeof obj === 'object') { + return Object.keys(obj).map(function (k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function (v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + } + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); + }; + + var querystring = createCommonjsModule(function (module, exports) { + exports.decode = exports.parse = decode; + exports.encode = exports.stringify = encode; + }); + var querystring_1 = querystring.decode; + var querystring_2 = querystring.parse; + var querystring_3 = querystring.encode; + var querystring_4 = querystring.stringify; + + var reactorQueryString = { + parse: function (string) { + if (typeof string === 'string') { + string = string.trim().replace(/^[?#&]/, ''); + } + return querystring.parse(string); + }, + stringify: function (object) { + return querystring.stringify(object); + } + }; + + const { + parse, + stringify + } = reactorQueryString; + const ANCHOR = document.createElement("a"); + const CACHE = {}; + function parseQueryString(value) { + try { + return parse(value); + } catch (e) { + return {}; + } + } + function stringifyQueryString(value) { + try { + return stringify(value); + } catch (e) { + return ""; + } + } + function decode$1(value) { + try { + return decodeURIComponent(value); + } catch (e) { + return value; + } + } + function encode$1(value) { + try { + return encodeURIComponent(value); + } catch (e) { + return value; + } + } + function parseUri$1(url) { + if (CACHE[url]) { + return CACHE[url]; + } + ANCHOR.href = url; + const parsedUri = parseUri(ANCHOR.href); + parsedUri.queryKey = parseQueryString(parsedUri.query); + CACHE[url] = parsedUri; + return CACHE[url]; + } + + const { + get: getCookie, + set: setCookie, + remove: removeCookie + } = reactorCookie; + const MBOX_COOKIE = "mbox"; + function createCookie(name, value, expires) { + return { + name, + value, + expires + }; + } + function deserialize(str) { + const parts = split("#", str); + if (isEmpty(parts) || parts.length < 3) { + return null; + } + if (isNaN(parseInt(parts[2], 10))) { + return null; + } + return createCookie(decode$1(parts[0]), decode$1(parts[1]), Number(parts[2])); + } + function getInternalCookies(cookieValue) { + if (isBlank(cookieValue)) { + return []; + } + return split("|", cookieValue); + } + function readCookies() { + const cookies = map(deserialize, getInternalCookies(getCookie(MBOX_COOKIE))); + const nowInSeconds = Math.ceil(now() / 1000); + const isExpired = val => isObject(val) && nowInSeconds <= val.expires; + return reduce((acc, val) => { + acc[val.name] = val; + return acc; + }, {}, filter(isExpired, cookies)); + } + + function getTargetCookie(name) { + const cookiesMap = readCookies(); + const cookie = cookiesMap[name]; + return isObject(cookie) ? cookie.value : ""; + } + function serialize(cookie) { + return join("#", [encode$1(cookie.name), encode$1(cookie.value), cookie.expires]); + } + function getExpires(cookie) { + return cookie.expires; + } + function getMaxExpires(cookies) { + const expires = map(getExpires, cookies); + return Math.max.apply(null, expires); + } + function saveCookies(cookiesMap, domain, secure) { + const cookies = toArray(cookiesMap); + const maxExpires = Math.abs(getMaxExpires(cookies) * 1000 - now()); + const serializedCookies = join("|", map(serialize, cookies)); + const expires = new Date(now() + maxExpires); + const attrs = reactorObjectAssign({ + domain, + expires, + secure + }, secure ? { + sameSite: SAMESITE_NONE + } : {}); + setCookie(MBOX_COOKIE, serializedCookies, attrs); + } + function setTargetCookie(options) { + const { + name, + value, + expires, + domain, + secure + } = options; + const cookiesMap = readCookies(); + cookiesMap[name] = createCookie(name, value, Math.ceil(expires + now() / 1000)); + saveCookies(cookiesMap, domain, secure); + } + + function isCookiePresent(name) { + return isNotBlank(getCookie(name)); + } + function isParamPresent(win, name) { + const { + location + } = win; + const { + search + } = location; + const params = parseQueryString(search); + return isNotBlank(params[name]); + } + function isRefParamPresent(doc, name) { + const { + referrer + } = doc; + const parsedUri = parseUri$1(referrer); + const refParams = parsedUri.queryKey; + return isNil(refParams) ? false : isNotBlank(refParams[name]); + } + function exists(win, doc, name) { + return isCookiePresent(name) || isParamPresent(win, name) || isRefParamPresent(doc, name); + } + + function isCookieEnabled() { + const config = getConfig(); + const cookieDomain = config[COOKIE_DOMAIN]; + const secure = config[SECURE_ONLY]; + const attrs = reactorObjectAssign({ + domain: cookieDomain, + secure + }, secure ? { + sameSite: SAMESITE_NONE + } : {}); + setCookie(CHECK, TRUE, attrs); + const result = getCookie(CHECK) === TRUE; + removeCookie(CHECK); + return result; + } + function isDeliveryDisabled() { + return exists(window, document, DISABLE); + } + function isDeliveryEnabled() { + const config = getConfig(); + const enabled = config[ENABLED]; + return enabled && isCookieEnabled() && !isDeliveryDisabled(); + } + function isDebugEnabled() { + return exists(window, document, DEBUG); + } + function isAuthoringEnabled() { + return exists(window, document, AUTHORING); + } + + const ADOBE_TARGET_PREFIX = "AT:"; + function exists$1(win, method) { + const { + console + } = win; + return !isNil(console) && isFunction(console[method]); + } + function warn(win, args) { + const { + console + } = win; + if (!exists$1(win, "warn")) { + return; + } + console.warn.apply(console, [ADOBE_TARGET_PREFIX].concat(args)); + } + function debug(win, args) { + const { + console + } = win; + if (!exists$1(win, "debug")) { + return; + } + if (isDebugEnabled()) { + console.debug.apply(console, [ADOBE_TARGET_PREFIX].concat(args)); + } + } + + function logWarn(...args) { + warn(window, args); + } + function logDebug(...args) { + debug(window, args); + } + const logger = { + debug: logDebug, + error: logWarn, + built: true + }; + + const TRACES_FORMAT_VERSION = "1"; + function getSettings(config) { + return reduce((acc, key) => { + acc[key] = config[key]; + return acc; + }, {}, OVERRIDABLE_SETTINGS); + } + function initialize(win, config, debugEnabled) { + const result = win[TRACES] || []; + win[TRACES] = result; + if (!debugEnabled) { + return; + } + const oldPush = result.push; + result[VERSION] = TRACES_FORMAT_VERSION; + result[SETTINGS] = getSettings(config); + result[CLIENT_TRACES] = []; + result[SERVER_TRACES] = []; + result.push = function push(trace) { + result[SERVER_TRACES].push(reactorObjectAssign({ + timestamp: now() + }, trace)); + oldPush.call(this, trace); + }; + } + function saveTrace(win, namespace, trace, debugEnabled) { + if (namespace === SERVER_TRACES) { + win[TRACES].push(trace); + } + if (!debugEnabled) { + return; + } + if (namespace !== SERVER_TRACES) { + win[TRACES][namespace].push(reactorObjectAssign({ + timestamp: now() + }, trace)); + } + } + + function initTraces() { + initialize(window, getConfig(), isDebugEnabled()); + } + function addServerTrace(trace) { + saveTrace(window, SERVER_TRACES, trace, isDebugEnabled()); + } + function addClientTrace(trace) { + saveTrace(window, CLIENT_TRACES, trace, isDebugEnabled()); + } + + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + }); + } + + var setTimeoutFunc = setTimeout; + function isArray$1(x) { + return Boolean(x && typeof x.length !== 'undefined'); + } + function noop$1() {} + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise$1(fn) { + if (!(this instanceof Promise$1)) throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise$1._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise$1) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise$1._immediateFn(function () { + if (!self._handled) { + Promise$1._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + Promise$1.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise$1.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop$1); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise$1.prototype['finally'] = finallyConstructor; + Promise$1.all = function (arr) { + return new Promise$1(function (resolve, reject) { + if (!isArray$1(arr)) { + return reject(new TypeError('Promise.all accepts an array')); + } + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise$1.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise$1) { + return value; + } + return new Promise$1(function (resolve) { + resolve(value); + }); + }; + Promise$1.reject = function (value) { + return new Promise$1(function (resolve, reject) { + reject(value); + }); + }; + Promise$1.race = function (arr) { + return new Promise$1(function (resolve, reject) { + if (!isArray$1(arr)) { + return reject(new TypeError('Promise.race accepts an array')); + } + for (var i = 0, len = arr.length; i < len; i++) { + Promise$1.resolve(arr[i]).then(resolve, reject); + } + }); + }; + Promise$1._immediateFn = + typeof setImmediate === 'function' && function (fn) { + setImmediate(fn); + } || function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise$1._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + + var src = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': Promise$1 + }); + + var require$$0 = getCjsExportFromNamespace(src); + + var reactorPromise = typeof window !== 'undefined' && window.Promise || typeof commonjsGlobal !== 'undefined' && commonjsGlobal.Promise || require$$0.default || require$$0; + + var $ = (function (window) { + var Zepto = function () { + var undefined$1, + key, + $, + classList, + emptyArray = [], + concat = emptyArray.concat, + filter = emptyArray.filter, + slice = emptyArray.slice, + document = window.document, + elementDisplay = {}, + classCache = {}, + cssNumber = { + "column-count": 1, + columns: 1, + "font-weight": 1, + "line-height": 1, + opacity: 1, + "z-index": 1, + zoom: 1 + }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + methodAttributes = ["val", "css", "html", "text", "data", "width", "height", "offset"], + adjacencyOperators = ["after", "prepend", "before", "append"], + table = document.createElement("table"), + tableRow = document.createElement("tr"), + containers = { + tr: document.createElement("tbody"), + tbody: table, + thead: table, + tfoot: table, + td: tableRow, + th: tableRow, + "*": document.createElement("div") + }, + readyRE = /complete|loaded|interactive/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, + uniq, + tempParent = document.createElement("div"), + propMap = { + tabindex: "tabIndex", + readonly: "readOnly", + 'for': "htmlFor", + 'class': "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + isArray = Array.isArray || function (object) { + return object instanceof Array; + }; + zepto.matches = function (element, selector) { + if (!selector || !element || element.nodeType !== 1) return false; + var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.matchesSelector; + if (matchesSelector) return matchesSelector.call(element, selector); + var match, + parent = element.parentNode, + temp = !parent; + if (temp) (parent = tempParent).appendChild(element); + match = ~zepto.qsa(parent, selector).indexOf(element); + temp && tempParent.removeChild(element); + return match; + }; + function type(obj) { + return obj == null ? String(obj) : class2type[toString.call(obj)] || "object"; + } + function isFunction(value) { + return type(value) == "function"; + } + function isWindow(obj) { + return obj != null && obj == obj.window; + } + function isDocument(obj) { + return obj != null && obj.nodeType == obj.DOCUMENT_NODE; + } + function isObject(obj) { + return type(obj) == "object"; + } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype; + } + function likeArray(obj) { + var length = !!obj && "length" in obj && obj.length, + type = $.type(obj); + return "function" != type && !isWindow(obj) && ("array" == type || length === 0 || typeof length == "number" && length > 0 && length - 1 in obj); + } + function compact(array) { + return filter.call(array, function (item) { + return item != null; + }); + } + function flatten(array) { + return array.length > 0 ? $.fn.concat.apply([], array) : array; + } + camelize = function (str) { + return str.replace(/-+(.)?/g, function (match, chr) { + return chr ? chr.toUpperCase() : ""; + }); + }; + function dasherize(str) { + return str.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase(); + } + uniq = function (array) { + return filter.call(array, function (item, idx) { + return array.indexOf(item) == idx; + }); + }; + function classRE(name) { + return name in classCache ? classCache[name] : classCache[name] = new RegExp("(^|\\s)" + name + "(\\s|$)"); + } + function maybeAddPx(name, value) { + return typeof value == "number" && !cssNumber[dasherize(name)] ? value + "px" : value; + } + function defaultDisplay(nodeName) { + var element, display; + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName); + document.body.appendChild(element); + display = getComputedStyle(element, "").getPropertyValue("display"); + element.parentNode.removeChild(element); + display == "none" && (display = "block"); + elementDisplay[nodeName] = display; + } + return elementDisplay[nodeName]; + } + function children(element) { + return "children" in element ? slice.call(element.children) : $.map(element.childNodes, function (node) { + if (node.nodeType == 1) return node; + }); + } + function Z(dom, selector) { + var i, + len = dom ? dom.length : 0; + for (i = 0; i < len; i++) this[i] = dom[i]; + this.length = len; + this.selector = selector || ""; + } + zepto.fragment = function (html, name, properties) { + var dom, nodes, container; + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)); + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>"); + if (name === undefined$1) name = fragmentRE.test(html) && RegExp.$1; + if (!(name in containers)) name = "*"; + container = containers[name]; + container.innerHTML = "" + html; + dom = $.each(slice.call(container.childNodes), function () { + container.removeChild(this); + }); + } + if (isPlainObject(properties)) { + nodes = $(dom); + $.each(properties, function (key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value);else nodes.attr(key, value); + }); + } + return dom; + }; + zepto.Z = function (dom, selector) { + return new Z(dom, selector); + }; + zepto.isZ = function (object) { + return object instanceof zepto.Z; + }; + zepto.init = function (selector, context) { + var dom; + if (!selector) return zepto.Z();else if (typeof selector == "string") { + selector = selector.trim(); + if (selector[0] == "<" && fragmentRE.test(selector)) dom = zepto.fragment(selector, RegExp.$1, context), selector = null;else if (context !== undefined$1) + return $(context).find(selector); + else dom = zepto.qsa(document, selector); + } else if (isFunction(selector)) + return $(document).ready(selector);else if (zepto.isZ(selector)) + return selector;else { + if (isArray(selector)) dom = compact(selector);else if (isObject(selector)) + dom = [selector], selector = null;else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null;else if (context !== undefined$1) + return $(context).find(selector); + else dom = zepto.qsa(document, selector); + } + return zepto.Z(dom, selector); + }; + $ = function (selector, context) { + return zepto.init(selector, context); + }; + function extend(target, source, deep) { + for (key in source) if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) target[key] = {}; + if (isArray(source[key]) && !isArray(target[key])) target[key] = []; + extend(target[key], source[key], deep); + } else if (source[key] !== undefined$1) target[key] = source[key]; + } + $.extend = function (target) { + var deep, + args = slice.call(arguments, 1); + if (typeof target == "boolean") { + deep = target; + target = args.shift(); + } + args.forEach(function (arg) { + extend(target, arg, deep); + }); + return target; + }; + zepto.qsa = function (element, selector) { + var found, + maybeID = selector[0] == "#", + maybeClass = !maybeID && selector[0] == ".", + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, + isSimple = simpleSelectorRE.test(nameOnly); + return element.getElementById && isSimple && maybeID + ? (found = element.getElementById(nameOnly)) ? [found] : [] : element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11 ? [] : slice.call(isSimple && !maybeID && element.getElementsByClassName + ? maybeClass ? element.getElementsByClassName(nameOnly) + : element.getElementsByTagName(selector) + : element.querySelectorAll(selector) + ); + }; + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector); + } + $.contains = document.documentElement.contains ? function (parent, node) { + return parent !== node && parent.contains(node); + } : function (parent, node) { + while (node && (node = node.parentNode)) if (node === parent) return true; + return false; + }; + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg; + } + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value); + } + function className(node, value) { + var klass = node.className || "", + svg = klass && klass.baseVal !== undefined$1; + if (value === undefined$1) return svg ? klass.baseVal : klass; + svg ? klass.baseVal = value : node.className = value; + } + function deserializeValue(value) { + try { + return value ? value == "true" || (value == "false" ? false : value == "null" ? null : +value + "" == value ? +value : /^[\[\{]/.test(value) ? $.parseJSON(value) : value) : value; + } catch (e) { + return value; + } + } + $.type = type; + $.isFunction = isFunction; + $.isWindow = isWindow; + $.isArray = isArray; + $.isPlainObject = isPlainObject; + $.isEmptyObject = function (obj) { + var name; + for (name in obj) return false; + return true; + }; + $.isNumeric = function (val) { + var num = Number(val), + type = typeof val; + return val != null && type != "boolean" && (type != "string" || val.length) && !isNaN(num) && isFinite(num) || false; + }; + $.inArray = function (elem, array, i) { + return emptyArray.indexOf.call(array, elem, i); + }; + $.camelCase = camelize; + $.trim = function (str) { + return str == null ? "" : String.prototype.trim.call(str); + }; + $.uuid = 0; + $.support = {}; + $.expr = {}; + $.noop = function () {}; + $.map = function (elements, callback) { + var value, + values = [], + i, + key; + if (likeArray(elements)) for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i); + if (value != null) values.push(value); + } else for (key in elements) { + value = callback(elements[key], key); + if (value != null) values.push(value); + } + return flatten(values); + }; + $.each = function (elements, callback) { + var i, key; + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) if (callback.call(elements[i], i, elements[i]) === false) return elements; + } else { + for (key in elements) if (callback.call(elements[key], key, elements[key]) === false) return elements; + } + return elements; + }; + $.grep = function (elements, callback) { + return filter.call(elements, callback); + }; + if (window.JSON) $.parseJSON = JSON.parse; + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (i, name) { + class2type["[object " + name + "]"] = name.toLowerCase(); + }); + $.fn = { + constructor: zepto.Z, + length: 0, + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + splice: emptyArray.splice, + indexOf: emptyArray.indexOf, + concat: function () { + var i, + value, + args = []; + for (i = 0; i < arguments.length; i++) { + value = arguments[i]; + args[i] = zepto.isZ(value) ? value.toArray() : value; + } + return concat.apply(zepto.isZ(this) ? this.toArray() : this, args); + }, + map: function (fn) { + return $($.map(this, function (el, i) { + return fn.call(el, i, el); + })); + }, + slice: function () { + return $(slice.apply(this, arguments)); + }, + ready: function (callback) { + if (readyRE.test(document.readyState) && document.body) callback($);else document.addEventListener("DOMContentLoaded", function () { + callback($); + }, false); + return this; + }, + get: function (idx) { + return idx === undefined$1 ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]; + }, + toArray: function () { + return this.get(); + }, + size: function () { + return this.length; + }, + remove: function () { + return this.each(function () { + if (this.parentNode != null) this.parentNode.removeChild(this); + }); + }, + each: function (callback) { + var len = this.length, + idx = 0, + el; + while (idx < len) { + el = this[idx]; + if (callback.call(el, idx, el) === false) { + break; + } + idx++; + } + return this; + }, + filter: function (selector) { + if (isFunction(selector)) return this.not(this.not(selector)); + return $(filter.call(this, function (element) { + return zepto.matches(element, selector); + })); + }, + add: function (selector, context) { + return $(uniq(this.concat($(selector, context)))); + }, + is: function (selector) { + return this.length > 0 && zepto.matches(this[0], selector); + }, + not: function (selector) { + var nodes = []; + if (isFunction(selector) && selector.call !== undefined$1) this.each(function (idx) { + if (!selector.call(this, idx)) nodes.push(this); + });else { + var excludes = typeof selector == "string" ? this.filter(selector) : likeArray(selector) && isFunction(selector.item) ? slice.call(selector) : $(selector); + this.forEach(function (el) { + if (excludes.indexOf(el) < 0) nodes.push(el); + }); + } + return $(nodes); + }, + has: function (selector) { + return this.filter(function () { + return isObject(selector) ? $.contains(this, selector) : $(this).find(selector).size(); + }); + }, + eq: function (idx) { + return idx === -1 ? this.slice(idx) : this.slice(idx, +idx + 1); + }, + first: function () { + var el = this[0]; + return el && !isObject(el) ? el : $(el); + }, + last: function () { + var el = this[this.length - 1]; + return el && !isObject(el) ? el : $(el); + }, + find: function (selector) { + var result, + $this = this; + if (!selector) result = $();else if (typeof selector == "object") result = $(selector).filter(function () { + var node = this; + return emptyArray.some.call($this, function (parent) { + return $.contains(parent, node); + }); + });else if (this.length == 1) result = $(zepto.qsa(this[0], selector));else result = this.map(function () { + return zepto.qsa(this, selector); + }); + return result; + }, + closest: function (selector, context) { + var nodes = [], + collection = typeof selector == "object" && $(selector); + this.each(function (_, node) { + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) node = node !== context && !isDocument(node) && node.parentNode; + if (node && nodes.indexOf(node) < 0) nodes.push(node); + }); + return $(nodes); + }, + parents: function (selector) { + var ancestors = [], + nodes = this; + while (nodes.length > 0) nodes = $.map(nodes, function (node) { + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node); + return node; + } + }); + return filtered(ancestors, selector); + }, + parent: function (selector) { + return filtered(uniq(this.pluck("parentNode")), selector); + }, + children: function (selector) { + return filtered(this.map(function () { + return children(this); + }), selector); + }, + contents: function () { + return this.map(function () { + return this.contentDocument || slice.call(this.childNodes); + }); + }, + siblings: function (selector) { + return filtered(this.map(function (i, el) { + return filter.call(children(el.parentNode), function (child) { + return child !== el; + }); + }), selector); + }, + empty: function () { + return this.each(function () { + this.innerHTML = ""; + }); + }, + pluck: function (property) { + return $.map(this, function (el) { + return el[property]; + }); + }, + show: function () { + return this.each(function () { + this.style.display == "none" && (this.style.display = ""); + if (getComputedStyle(this, "").getPropertyValue("display") == "none") this.style.display = defaultDisplay(this.nodeName); + }); + }, + replaceWith: function (newContent) { + return this.before(newContent).remove(); + }, + wrap: function (structure) { + var func = isFunction(structure); + if (this[0] && !func) var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1; + return this.each(function (index) { + $(this).wrapAll(func ? structure.call(this, index) : clone ? dom.cloneNode(true) : dom); + }); + }, + wrapAll: function (structure) { + if (this[0]) { + $(this[0]).before(structure = $(structure)); + var children; + while ((children = structure.children()).length) structure = children.first(); + $(structure).append(this); + } + return this; + }, + wrapInner: function (structure) { + var func = isFunction(structure); + return this.each(function (index) { + var self = $(this), + contents = self.contents(), + dom = func ? structure.call(this, index) : structure; + contents.length ? contents.wrapAll(dom) : self.append(dom); + }); + }, + unwrap: function () { + this.parent().each(function () { + $(this).replaceWith($(this).children()); + }); + return this; + }, + clone: function () { + return this.map(function () { + return this.cloneNode(true); + }); + }, + hide: function () { + return this.css("display", "none"); + }, + toggle: function (setting) { + return this.each(function () { + var el = $(this); + (setting === undefined$1 ? el.css("display") == "none" : setting) ? el.show() : el.hide(); + }); + }, + prev: function (selector) { + return $(this.pluck("previousElementSibling")).filter(selector || "*"); + }, + next: function (selector) { + return $(this.pluck("nextElementSibling")).filter(selector || "*"); + }, + html: function (html) { + return 0 in arguments ? this.each(function (idx) { + var originHtml = this.innerHTML; + $(this).empty().append(funcArg(this, html, idx, originHtml)); + }) : 0 in this ? this[0].innerHTML : null; + }, + text: function (text) { + return 0 in arguments ? this.each(function (idx) { + var newText = funcArg(this, text, idx, this.textContent); + this.textContent = newText == null ? "" : "" + newText; + }) : 0 in this ? this.pluck("textContent").join("") : null; + }, + attr: function (name, value) { + var result; + return typeof name == "string" && !(1 in arguments) ? 0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined$1 : this.each(function (idx) { + if (this.nodeType !== 1) return; + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]);else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))); + }); + }, + removeAttr: function (name) { + return this.each(function () { + this.nodeType === 1 && name.split(" ").forEach(function (attribute) { + setAttribute(this, attribute); + }, this); + }); + }, + prop: function (name, value) { + name = propMap[name] || name; + return 1 in arguments ? this.each(function (idx) { + this[name] = funcArg(this, value, idx, this[name]); + }) : this[0] && this[0][name]; + }, + removeProp: function (name) { + name = propMap[name] || name; + return this.each(function () { + delete this[name]; + }); + }, + data: function (name, value) { + var attrName = "data-" + name.replace(capitalRE, "-$1").toLowerCase(); + var data = 1 in arguments ? this.attr(attrName, value) : this.attr(attrName); + return data !== null ? deserializeValue(data) : undefined$1; + }, + val: function (value) { + if (0 in arguments) { + if (value == null) value = ""; + return this.each(function (idx) { + this.value = funcArg(this, value, idx, this.value); + }); + } else { + return this[0] && (this[0].multiple ? $(this[0]).find("option").filter(function () { + return this.selected; + }).pluck("value") : this[0].value); + } + }, + offset: function (coordinates) { + if (coordinates) return this.each(function (index) { + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + }; + if ($this.css("position") == "static") props["position"] = "relative"; + $this.css(props); + }); + if (!this.length) return null; + if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0])) return { + top: 0, + left: 0 + }; + var obj = this[0].getBoundingClientRect(); + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + }; + }, + css: function (property, value) { + if (arguments.length < 2) { + var element = this[0]; + if (typeof property == "string") { + if (!element) return; + return element.style[camelize(property)] || getComputedStyle(element, "").getPropertyValue(property); + } else if (isArray(property)) { + if (!element) return; + var props = {}; + var computedStyle = getComputedStyle(element, ""); + $.each(property, function (_, prop) { + props[prop] = element.style[camelize(prop)] || computedStyle.getPropertyValue(prop); + }); + return props; + } + } + var css = ""; + if (type(property) == "string") { + if (!value && value !== 0) this.each(function () { + this.style.removeProperty(dasherize(property)); + });else css = dasherize(property) + ":" + maybeAddPx(property, value); + } else { + for (key in property) if (!property[key] && property[key] !== 0) this.each(function () { + this.style.removeProperty(dasherize(key)); + });else css += dasherize(key) + ":" + maybeAddPx(key, property[key]) + ";"; + } + return this.each(function () { + this.style.cssText += ";" + css; + }); + }, + index: function (element) { + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]); + }, + hasClass: function (name) { + if (!name) return false; + return emptyArray.some.call(this, function (el) { + return this.test(className(el)); + }, classRE(name)); + }, + addClass: function (name) { + if (!name) return this; + return this.each(function (idx) { + if (!("className" in this)) return; + classList = []; + var cls = className(this), + newName = funcArg(this, name, idx, cls); + newName.split(/\s+/g).forEach(function (klass) { + if (!$(this).hasClass(klass)) classList.push(klass); + }, this); + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")); + }); + }, + removeClass: function (name) { + return this.each(function (idx) { + if (!("className" in this)) return; + if (name === undefined$1) return className(this, ""); + classList = className(this); + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function (klass) { + classList = classList.replace(classRE(klass), " "); + }); + className(this, classList.trim()); + }); + }, + toggleClass: function (name, when) { + if (!name) return this; + return this.each(function (idx) { + var $this = $(this), + names = funcArg(this, name, idx, className(this)); + names.split(/\s+/g).forEach(function (klass) { + (when === undefined$1 ? !$this.hasClass(klass) : when) ? $this.addClass(klass) : $this.removeClass(klass); + }); + }); + }, + scrollTop: function (value) { + if (!this.length) return; + var hasScrollTop = ("scrollTop" in this[0]); + if (value === undefined$1) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset; + return this.each(hasScrollTop ? function () { + this.scrollTop = value; + } : function () { + this.scrollTo(this.scrollX, value); + }); + }, + scrollLeft: function (value) { + if (!this.length) return; + var hasScrollLeft = ("scrollLeft" in this[0]); + if (value === undefined$1) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset; + return this.each(hasScrollLeft ? function () { + this.scrollLeft = value; + } : function () { + this.scrollTo(value, this.scrollY); + }); + }, + position: function () { + if (!this.length) return; + var elem = this[0], + offsetParent = this.offsetParent(), + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { + top: 0, + left: 0 + } : offsetParent.offset(); + offset.top -= parseFloat($(elem).css("margin-top")) || 0; + offset.left -= parseFloat($(elem).css("margin-left")) || 0; + parentOffset.top += parseFloat($(offsetParent[0]).css("border-top-width")) || 0; + parentOffset.left += parseFloat($(offsetParent[0]).css("border-left-width")) || 0; + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + }, + offsetParent: function () { + return this.map(function () { + var parent = this.offsetParent || document.body; + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") parent = parent.offsetParent; + return parent; + }); + } + }; + $.fn.detach = $.fn.remove; + ["width", "height"].forEach(function (dimension) { + var dimensionProperty = dimension.replace(/./, function (m) { + return m[0].toUpperCase(); + }); + $.fn[dimension] = function (value) { + var offset, + el = this[0]; + if (value === undefined$1) return isWindow(el) ? el["inner" + dimensionProperty] : isDocument(el) ? el.documentElement["scroll" + dimensionProperty] : (offset = this.offset()) && offset[dimension];else return this.each(function (idx) { + el = $(this); + el.css(dimension, funcArg(this, value, idx, el[dimension]())); + }); + }; + }); + function traverseNode(node, fun) { + fun(node); + for (var i = 0, len = node.childNodes.length; i < len; i++) traverseNode(node.childNodes[i], fun); + } + function executeScript(doc, content, nonce) { + const nearestNode = doc.getElementsByTagName("script")[0]; + if (!nearestNode) { + return; + } + const parentNode = nearestNode.parentNode; + if (!parentNode) { + return; + } + const script = doc.createElement("script"); + script.innerHTML = content; + if (isNotBlank(nonce)) { + script.setAttribute("nonce", nonce); + } + parentNode.appendChild(script); + parentNode.removeChild(script); + } + adjacencyOperators.forEach(function (operator, operatorIndex) { + var inside = operatorIndex % 2; + $.fn[operator] = function () { + var argType, + nodes = $.map(arguments, function (arg) { + var arr = []; + argType = type(arg); + if (argType == "array") { + arg.forEach(function (el) { + if (el.nodeType !== undefined$1) return arr.push(el);else if ($.zepto.isZ(el)) return arr = arr.concat(el.get()); + arr = arr.concat(zepto.fragment(el)); + }); + return arr; + } + return argType == "object" || arg == null ? arg : zepto.fragment(arg); + }), + parent, + copyByClone = this.length > 1; + if (nodes.length < 1) return this; + return this.each(function (_, target) { + parent = inside ? target : target.parentNode; + target = operatorIndex == 0 ? target.nextSibling : operatorIndex == 1 ? target.firstChild : operatorIndex == 2 ? target : null; + const parentInDocument = $.contains(document.documentElement, parent); + const SCRIPT_TYPES = /^(text|application)\/(javascript|ecmascript)$/; + const config = getConfig(); + const scriptNonce = config[CSP_SCRIPT_NONCE]; + const styleNonce = config[CSP_STYLE_NONCE]; + nodes.forEach(function (node) { + if (copyByClone) node = node.cloneNode(true);else if (!parent) return $(node).remove(); + if (isNotBlank(scriptNonce) && node.tagName === "SCRIPT") { + node.setAttribute("nonce", scriptNonce); + } + if (isNotBlank(styleNonce) && node.tagName === "STYLE") { + node.setAttribute("nonce", styleNonce); + } + parent.insertBefore(node, target); + if (parentInDocument) traverseNode(node, function (el) { + if (el.nodeName != null && el.nodeName.toUpperCase() === "SCRIPT" && (!el.type || SCRIPT_TYPES.test(el.type.toLowerCase())) && !el.src) { + executeScript(document, el.innerHTML, el.nonce); + } + }); + }); + }); + }; + $.fn[inside ? operator + "To" : "insert" + (operatorIndex ? "Before" : "After")] = function (html) { + $(html)[operator](this); + return this; + }; + }); + zepto.Z.prototype = Z.prototype = $.fn; + zepto.uniq = uniq; + zepto.deserializeValue = deserializeValue; + $.zepto = zepto; + return $; + }(); + (function ($) { + var _zid = 1, + undefined$1, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function (obj) { + return typeof obj == "string"; + }, + handlers = {}, + specialEvents = {}, + focusinSupported = ("onfocusin" in window), + focus = { + focus: "focusin", + blur: "focusout" + }, + hover = { + mouseenter: "mouseover", + mouseleave: "mouseout" + }; + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = "MouseEvents"; + function zid(element) { + return element._zid || (element._zid = _zid++); + } + function findHandlers(element, event, fn, selector) { + event = parse(event); + if (event.ns) var matcher = matcherFor(event.ns); + return (handlers[zid(element)] || []).filter(function (handler) { + return handler && (!event.e || handler.e == event.e) && (!event.ns || matcher.test(handler.ns)) && (!fn || zid(handler.fn) === zid(fn)) && (!selector || handler.sel == selector); + }); + } + function parse(event) { + var parts = ("" + event).split("."); + return { + e: parts[0], + ns: parts.slice(1).sort().join(" ") + }; + } + function matcherFor(ns) { + return new RegExp("(?:^| )" + ns.replace(" ", " .* ?") + "(?: |$)"); + } + function eventCapture(handler, captureSetting) { + return handler.del && !focusinSupported && handler.e in focus || !!captureSetting; + } + function realEvent(type) { + return hover[type] || focusinSupported && focus[type] || type; + } + function add(element, events, fn, data, selector, delegator, capture) { + var id = zid(element), + set = handlers[id] || (handlers[id] = []); + events.split(/\s/).forEach(function (event) { + if (event == "ready") return $(document).ready(fn); + var handler = parse(event); + handler.fn = fn; + handler.sel = selector; + if (handler.e in hover) fn = function (e) { + var related = e.relatedTarget; + if (!related || related !== this && !$.contains(this, related)) return handler.fn.apply(this, arguments); + }; + handler.del = delegator; + var callback = delegator || fn; + handler.proxy = function (e) { + e = compatible(e); + if (e.isImmediatePropagationStopped()) return; + e.data = data; + var result = callback.apply(element, e._args == undefined$1 ? [e] : [e].concat(e._args)); + if (result === false) e.preventDefault(), e.stopPropagation(); + return result; + }; + handler.i = set.length; + set.push(handler); + if ("addEventListener" in element) element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)); + }); + } + function remove(element, events, fn, selector, capture) { + var id = zid(element); + (events || "").split(/\s/).forEach(function (event) { + findHandlers(element, event, fn, selector).forEach(function (handler) { + delete handlers[id][handler.i]; + if ("removeEventListener" in element) element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)); + }); + }); + } + $.event = { + add: add, + remove: remove + }; + $.proxy = function (fn, context) { + var args = 2 in arguments && slice.call(arguments, 2); + if (isFunction(fn)) { + var proxyFn = function () { + return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments); + }; + proxyFn._zid = zid(fn); + return proxyFn; + } else if (isString(context)) { + if (args) { + args.unshift(fn[context], fn); + return $.proxy.apply(null, args); + } else { + return $.proxy(fn[context], fn); + } + } else { + throw new TypeError("expected function"); + } + }; + $.fn.bind = function (event, data, callback) { + return this.on(event, data, callback); + }; + $.fn.unbind = function (event, callback) { + return this.off(event, callback); + }; + $.fn.one = function (event, selector, data, callback) { + return this.on(event, selector, data, callback, 1); + }; + var returnTrue = function () { + return true; + }, + returnFalse = function () { + return false; + }, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/, + eventMethods = { + preventDefault: "isDefaultPrevented", + stopImmediatePropagation: "isImmediatePropagationStopped", + stopPropagation: "isPropagationStopped" + }; + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event); + $.each(eventMethods, function (name, predicate) { + var sourceMethod = source[name]; + event[name] = function () { + this[predicate] = returnTrue; + return sourceMethod && sourceMethod.apply(source, arguments); + }; + event[predicate] = returnFalse; + }); + try { + event.timeStamp || (event.timeStamp = new Date().getTime()); + } catch (ignored) {} + if (source.defaultPrevented !== undefined$1 ? source.defaultPrevented : "returnValue" in source ? source.returnValue === false : source.getPreventDefault && source.getPreventDefault()) event.isDefaultPrevented = returnTrue; + } + return event; + } + function createProxy(event) { + var key, + proxy = { + originalEvent: event + }; + for (key in event) if (!ignoreProperties.test(key) && event[key] !== undefined$1) proxy[key] = event[key]; + return compatible(proxy, event); + } + $.fn.delegate = function (selector, event, callback) { + return this.on(event, selector, callback); + }; + $.fn.undelegate = function (selector, event, callback) { + return this.off(event, selector, callback); + }; + $.fn.live = function (event, callback) { + $(document.body).delegate(this.selector, event, callback); + return this; + }; + $.fn.die = function (event, callback) { + $(document.body).undelegate(this.selector, event, callback); + return this; + }; + $.fn.on = function (event, selector, data, callback, one) { + var autoRemove, + delegator, + $this = this; + if (event && !isString(event)) { + $.each(event, function (type, fn) { + $this.on(type, selector, data, fn, one); + }); + return $this; + } + if (!isString(selector) && !isFunction(callback) && callback !== false) callback = data, data = selector, selector = undefined$1; + if (callback === undefined$1 || data === false) callback = data, data = undefined$1; + if (callback === false) callback = returnFalse; + return $this.each(function (_, element) { + if (one) autoRemove = function (e) { + remove(element, e.type, callback); + return callback.apply(this, arguments); + }; + if (selector) delegator = function (e) { + var evt, + match = $(e.target).closest(selector, element).get(0); + if (match && match !== element) { + evt = $.extend(createProxy(e), { + currentTarget: match, + liveFired: element + }); + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))); + } + }; + add(element, event, callback, data, selector, delegator || autoRemove); + }); + }; + $.fn.off = function (event, selector, callback) { + var $this = this; + if (event && !isString(event)) { + $.each(event, function (type, fn) { + $this.off(type, selector, fn); + }); + return $this; + } + if (!isString(selector) && !isFunction(callback) && callback !== false) callback = selector, selector = undefined$1; + if (callback === false) callback = returnFalse; + return $this.each(function () { + remove(this, event, callback, selector); + }); + }; + $.fn.trigger = function (event, args) { + event = isString(event) || $.isPlainObject(event) ? $.Event(event) : compatible(event); + event._args = args; + return this.each(function () { + if (event.type in focus && typeof this[event.type] == "function") this[event.type]();else if ("dispatchEvent" in this) + this.dispatchEvent(event);else $(this).triggerHandler(event, args); + }); + }; + $.fn.triggerHandler = function (event, args) { + var e, result; + this.each(function (i, element) { + e = createProxy(isString(event) ? $.Event(event) : event); + e._args = args; + e.target = element; + $.each(findHandlers(element, event.type || event), function (i, handler) { + result = handler.proxy(e); + if (e.isImmediatePropagationStopped()) return false; + }); + }); + return result; + }; + ("focusin focusout focus blur load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select keydown keypress keyup error").split(" ").forEach(function (event) { + $.fn[event] = function (callback) { + return 0 in arguments ? this.bind(event, callback) : this.trigger(event); + }; + }); + $.Event = function (type, props) { + if (!isString(type)) props = type, type = props.type; + var event = document.createEvent(specialEvents[type] || "Events"), + bubbles = true; + if (props) for (var name in props) name == "bubbles" ? bubbles = !!props[name] : event[name] = props[name]; + event.initEvent(type, bubbles, true); + return compatible(event); + }; + })(Zepto); + (function () { + try { + getComputedStyle(undefined); + } catch (e) { + var nativeGetComputedStyle = getComputedStyle; + window.getComputedStyle = function (element, pseudoElement) { + try { + return nativeGetComputedStyle(element, pseudoElement); + } catch (e) { + return null; + } + }; + } + })(); + (function ($) { + var zepto = $.zepto, + oldQsa = zepto.qsa, + childRe = /^\s*>/, + classTag = "Zepto" + +new Date(); + zepto.qsa = function (node, selector) { + var sel = selector, + nodes, + taggedParent; + try { + if (!sel) sel = "*";else if (childRe.test(sel)) + taggedParent = $(node).addClass(classTag), sel = "." + classTag + " " + sel; + nodes = oldQsa(node, sel); + } catch (e) { + throw e; + } finally { + if (taggedParent) taggedParent.removeClass(classTag); + } + return nodes; + }; + })(Zepto); + return Zepto; + })(window); + + const MO_OBJECT = window.MutationObserver || window.WebkitMutationObserver; + function canUseMutationObserver() { + return isFunction(MO_OBJECT); + } + function getMutationObserver(callback) { + return new MO_OBJECT(callback); + } + + const ARRAY_EXPECTED = "Expected an array of promises"; + function getMoImmediateFn() { + const textnode = document.createTextNode(""); + const twiddleNode = () => { + textnode.textContent = textnode.textContent.length > 0 ? "" : "a"; + }; + const callbacks = []; + const mo = getMutationObserver(() => { + const len = callbacks.length; + for (let i = 0; i < len; i += 1) { + callbacks[i](); + } + callbacks.splice(0, len); + }); + mo.observe(textnode, { + characterData: true + }); + return fn => { + callbacks.push(fn); + twiddleNode(); + }; + } + function getOnReadyStateChangeImmediateFn() { + return fn => { + let scriptEl = $(" - +
diff --git a/react-shopping-cart-demo/package-lock.json b/react-shopping-cart-demo/package-lock.json index 62a059a..bf90ed6 100644 --- a/react-shopping-cart-demo/package-lock.json +++ b/react-shopping-cart-demo/package-lock.json @@ -13,6 +13,7 @@ "axios": "^0.19.0", "cookie-parser": "^1.4.4", "express": "^4.16.4", + "node-fetch": "^2.6.7", "prettier": "^2.4.0", "react": "^16.8.1", "react-dom": "^16.8.1", @@ -5375,11 +5376,22 @@ "dev": true }, "node_modules/node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, "engines": { "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/node-libs-browser": { @@ -7858,6 +7870,11 @@ "node": ">=0.6" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "node_modules/trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -8869,6 +8886,11 @@ "node": ">=0.10.0" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, "node_modules/webpack": { "version": "4.41.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.0.tgz", @@ -9375,6 +9397,15 @@ "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -14127,9 +14158,12 @@ "dev": true }, "node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "node-libs-browser": { "version": "2.2.1", @@ -16184,6 +16218,11 @@ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -17021,6 +17060,11 @@ } } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, "webpack": { "version": "4.41.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.41.0.tgz", @@ -17438,6 +17482,15 @@ "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", "integrity": "sha512-bJlen0FcuU/0EMLrdbJ7zOnW6ITZLrZMIarMUVmdKtsGvZna8vxKYaexICWPfZ8qwf9fzNq+UEIZrnSaApt6RA==" }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/react-shopping-cart-demo/package.json b/react-shopping-cart-demo/package.json index 1687de7..327d455 100644 --- a/react-shopping-cart-demo/package.json +++ b/react-shopping-cart-demo/package.json @@ -19,6 +19,7 @@ "axios": "^0.19.0", "cookie-parser": "^1.4.4", "express": "^4.16.4", + "node-fetch": "^2.6.7", "prettier": "^2.4.0", "react": "^16.8.1", "react-dom": "^16.8.1", diff --git a/react-shopping-cart-demo/public/assets/js/app.js b/react-shopping-cart-demo/public/assets/js/app.js index ebff76f..362c584 100644 --- a/react-shopping-cart-demo/public/assets/js/app.js +++ b/react-shopping-cart-demo/public/assets/js/app.js @@ -15,7 +15,7 @@ var n=r(162),i=r(163),o=r(164);function a(){return u.TYPED_ARRAY_SUPPORT?2147483 object-assign (c) Sindre Sorhus @license MIT -*/var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,u=a(e),c=1;c>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=d(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){e.exports=i;var n=r(59).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(60),i.Writable=r(173),i.Duplex=r(174),i.Transform=r(175),i.PassThrough=r(176),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function l(){for(var e=[],t=0;t0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=b(u,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){(t=e.exports=r(84)).Stream=t,t.Readable=t,t.Writable=r(61),t.Duplex=r(23),t.Transform=r(87),t.PassThrough=r(172)},function(e,t,r){"use strict";(function(t,n,i){var o=r(36);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=y;var c=r(31);c.inherits=r(2);var f={deprecate:r(171)},l=r(85),d=r(3).Buffer,h=i.Uint8Array||function(){};var p,b=r(86);function m(){}function y(e,t){s=s||r(23),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||r(23),!(p.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function g(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,g(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(g(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(v,l),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===v&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(17),r(169).setImmediate,r(9))},function(e,t,r){"use strict";var n=r(3).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(8).Buffer,i=r(2),o=r(83),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,k=0|this._e,T=0;T<80;T+=1){var x,M;T<16?(x=b(r,n,i,o,h,e[s[T]],l[0],c[T]),M=g(w,_,E,S,k,e[u[T]],d[0],f[T])):T<32?(x=m(r,n,i,o,h,e[s[T]],l[1],c[T]),M=v(w,_,E,S,k,e[u[T]],d[1],f[T])):T<48?(x=y(r,n,i,o,h,e[s[T]],l[2],c[T]),M=y(w,_,E,S,k,e[u[T]],d[2],f[T])):T<64?(x=v(r,n,i,o,h,e[s[T]],l[3],c[T]),M=m(w,_,E,S,k,e[u[T]],d[3],f[T])):(x=g(r,n,i,o,h,e[s[T]],l[4],c[T]),M=b(w,_,E,S,k,e[u[T]],d[4],f[T])),r=h,h=o,o=p(i,10),i=n,n=x,w=k,k=S,S=p(E,10),E=_,_=M}var C=this._b+i+S|0;this._b=this._c+o+k|0,this._c=this._d+h+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=C},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(177),t.sha1=r(178),t.sha224=r(179),t.sha256=r(88),t.sha384=r(180),t.sha512=r(89)},function(e,t,r){"use strict";t.utils=r(186),t.Cipher=r(187),t.DES=r(188),t.CBC=r(189),t.EDE=r(190)},function(e,t,r){var n=r(191),i=r(199),o=r(99);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(192),CBC:r(193),CFB:r(194),CFB8:r(195),CFB1:r(196),OFB:r(197),CTR:r(97),GCM:r(97)},i=r(99);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(8).Buffer)},function(e,t,r){"use strict";var n=t;n.version=r(209).version,n.utils=r(13),n.rand=r(68),n.curve=r(105),n.curves=r(71),n.ec=r(220),n.eddsa=r(224)},function(e,t,r){"use strict";var n,i=t,o=r(72),a=r(105),s=r(13).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(219)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(15),n.common=r(33),n.sha=r(213),n.ripemd=r(217),n.hmac=r(218),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){e.exports=r(252)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addToCart=void 0;a(r(11));var n=a(r(20)),i=r(130),o=r(26);function a(e){return e&&e.__esModule?e:{default:e}}t.addToCart=function(e,t){return(0,i.fireActionTriggerCustomEvent)(t,{detail:{linkName:t.getAttribute("data-link-name"),action:t.getAttribute("data-track-action")}}),function(t){return t({type:"REQUEST_ADD_TO_CART"}),n.default.post("cart",function(e){if(localStorage.getItem("guest"))return{id:e,guestKey:localStorage.getItem("guest")}}(e)).then((function(e){return e})).then((function(e){t({type:"RECEIVE_ADD_TO_CART",payload:e.data}),t((0,o.fetchCart)())}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addToWishlist=void 0;a(r(11));var n=a(r(20)),i=r(41),o=r(130);function a(e){return e&&e.__esModule?e:{default:e}}t.addToWishlist=function(e,t){return(0,o.fireActionTriggerCustomEvent)(t,{detail:{linkName:t.getAttribute("data-link-name"),action:t.getAttribute("data-track-action")}}),function(t){return t({type:"REQUEST_ADD_TO_WL"}),n.default.post("wishlist",function(e){if(localStorage.getItem("guest"))return{id:e,guestKey:localStorage.getItem("guest")}}(e)).then((function(e){return e})).then((function(e){t({type:"RECEIVE_ADD_TO_WL",payload:e.data}),t((0,i.fetchWishlist)())}))}}},function(e,t,r){"use strict";e.exports=r(144)},function(e,t,r){"use strict";var n=r(76),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?a:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=h(r);i&&i!==p&&e(t,i,n)}var a=f(r);l&&(a=a.concat(l(r)));for(var s=u(t),b=u(r),m=0;m0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.type,a=t.payload;if(r===i)return n({},e,{locationBeforeTransitions:a});return e};var i=t.LOCATION_CHANGE="@@router/LOCATION_CHANGE",o={locationBeforeTransitions:null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=t.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD";function i(e){return function(){for(var t=arguments.length,r=Array(t),i=0;i=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(36);e.exports=g;var o,a=r(165);g.ReadableState=v;r(59).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(85),c=r(3).Buffer,f=t.Uint8Array||function(){};var l=r(31);l.inherits=r(2);var d=r(166),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(167),m=r(86);l.inherits(g,u);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var n=t instanceof(o=o||r(23));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(62).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function g(e){if(o=o||r(23),!(this instanceof g))return new g(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(T,e):T(e))}function T(e){h("emit readable"),e.emit("readable"),P(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:g;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",g),r.removeListener("data",b),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(r);e.on("drain",l);var d=!1;var p=!1;function b(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){h("onerror",t),g(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),g()}function v(){h("onfinish"),e.removeListener("close",y),g()}function g(){h("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+h(r[y-15])+r[y-16];for(var v=0;v<64;++v){var g=m+d(u)+c(u,p,b)+a[v]+r[v]|0,w=l(n)+f(n,i,o)|0;m=b,b=p,p=u,u=s+g|0,s=o,o=i,i=n,n=g+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(2),i=r(28),o=r(3).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,g=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,k=0|this._el,T=0|this._fl,x=0|this._gl,M=0|this._hl,C=0;C<32;C+=2)t[C]=e.readInt32BE(4*C),t[C+1]=e.readInt32BE(4*C+4);for(;C<160;C+=2){var O=t[C-30],P=t[C-30+1],A=h(O,P),R=p(P,O),j=b(O=t[C-4],P=t[C-4+1]),I=m(P,O),N=t[C-14],L=t[C-14+1],B=t[C-32],D=t[C-32+1],U=R+L|0,z=A+N+y(U,R)|0;z=(z=z+j+y(U=U+I|0,I)|0)+B+y(U=U+D|0,D)|0,t[C]=z,t[C+1]=U}for(var F=0;F<160;F+=2){z=t[F],U=t[F+1];var q=f(r,n,i),H=f(w,_,E),W=l(r,w),V=l(w,r),K=d(s,k),Y=d(k,s),G=a[F],$=a[F+1],X=c(s,u,v),Q=c(k,T,x),J=M+Y|0,Z=g+K+y(J,M)|0;Z=(Z=(Z=Z+X+y(J=J+Q|0,Q)|0)+G+y(J=J+$|0,$)|0)+z+y(J=J+U|0,U)|0;var ee=V+H|0,te=W+q+y(ee,V)|0;g=v,M=x,v=u,x=T,u=s,T=k,s=o+Z+y(k=S+J|0,S)|0,o=i,S=E,i=n,E=_,n=r,_=w,r=Z+te+y(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+T|0,this._gl=this._gl+x|0,this._hl=this._hl+M|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,E)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,k)|0,this._fh=this._fh+u+y(this._fl,T)|0,this._gh=this._gh+v+y(this._gl,x)|0,this._hh=this._hh+g+y(this._hl,M)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";var n=r(2),i=r(181),o=r(19),a=r(3).Buffer,s=r(91),u=r(63),c=r(64),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(8).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(17))},function(e,t,r){var n=r(91),i=r(63),o=r(64),a=r(94),s=r(95),u=r(3).Buffer,c=u.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(m(p=r.shrn(1))&&m(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(6),i=r(68);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),f=s.toRed(o);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var d=l.toRed(o).redPow(c);if(0!==d.cmp(a)&&0!==d.cmp(f)){for(var h=1;h0;t--){var f=this._randrange(new n(2),a),l=e.gcd(f);if(0!==l.cmpn(1))return l;var d=f.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var h=1;h>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(39),n.short=r(210),n.mont=r(211),n.edwards=r(212)},function(e,t,r){"use strict";var n=r(15).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(15),i=r(33),o=r(106),a=r(12),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,c=n.length;c>=256;c>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;c=1+u;for(var f=n.length;f>0;c--,f>>=8)o[c]=255&f;return this._createEncoderBuffer([o,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n0?o.default.createElement(d.Link,{to:"checkout",className:"btn btn-primary btn-lg",onClick:this.props.closePopover},"Checkout your order"):"";return o.default.createElement("div",null,o.default.createElement(s.default,{title:"My Cart"}),o.default.createElement("section",{className:"section"},o.default.createElement("div",{className:"container"},o.default.createElement("table",{className:"table"},o.default.createElement("thead",null,o.default.createElement("tr",null,o.default.createElement("th",null,o.default.createElement("abbr",null,"ID")),o.default.createElement("th",null,o.default.createElement("abbr",null,"Title")),o.default.createElement("th",null,"Price"),o.default.createElement("th",null," "))),o.default.createElement("tfoot",null,o.default.createElement("tr",null,o.default.createElement("th",null," "),o.default.createElement("th",null," "),o.default.createElement("th",null,"Total: $",t),o.default.createElement("th",null," "))),o.default.createElement("tbody",null,Object.keys(this.props.cart).map((function(t){return o.default.createElement(l.default,{key:t,productKey:t,handleTrash:e.handleTrash.bind(e),product:e.getItemById(e.props.cart[t].id)})})))),r)))}}]),t}(i.Component);t.default=(0,a.connect)((function(e){return{cart:e.CartReducer.data,products:e.ProductsReducer.data}}))(p)},function(e,t){t.__esModule=!0;t.ATTRIBUTE_NAMES={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"};var r=t.TAG_NAMES={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},n=(t.VALID_TAG_NAMES=Object.keys(r).map((function(e){return r[e]})),t.TAG_PROPERTIES={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src"},t.REACT_TAG_MAP={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"});t.HELMET_PROPS={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},t.HTML_TAG_MAP=Object.keys(n).reduce((function(e,t){return e[n[t]]=t,e}),{}),t.SELF_CLOSING_TAGS=[r.NOSCRIPT,r.SCRIPT,r.STYLE],t.HELMET_ATTRIBUTE="data-react-helmet"},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u}).call(this,r(17))},function(e,t,r){"use strict";var n=r(10),i=r(259),o=r(120),a=r(261),s=r(262),u=r(124);e.exports=function(e){return new Promise((function(t,c){var f=e.data,l=e.headers;n.isFormData(f)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",p=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+p)}if(d.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};i(t,c,n),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var b=r(263),m=(e.withCredentials||s(e.url))&&e.xsrfCookieName?b.read(e.xsrfCookieName):void 0;m&&(l[e.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),c(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,r){"use strict";var n=r(260);e.exports=function(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t){t=t||{};var r={};return n.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(r[e]=t[e])})),n.forEach(["headers","auth","proxy"],(function(i){n.isObject(t[i])?r[i]=n.deepMerge(e[i],t[i]):void 0!==t[i]?r[i]=t[i]:n.isObject(e[i])?r[i]=n.deepMerge(e[i]):void 0!==e[i]&&(r[i]=e[i])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=l(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=l(o,r,n,i,e[8],2272392833,11),i=l(i,o,r,n,e[11],1839030562,16),n=l(n,i,o,r,e[14],4259657740,23),r=l(r,n,i,o,e[1],2763975236,4),o=l(o,r,n,i,e[4],1272893353,11),i=l(i,o,r,n,e[7],4139469664,16),n=l(n,i,o,r,e[10],3200236656,23),r=l(r,n,i,o,e[13],681279174,4),o=l(o,r,n,i,e[0],3936430074,11),i=l(i,o,r,n,e[3],3572445317,16),n=l(n,i,o,r,e[6],76029189,23),r=l(r,n,i,o,e[9],3654602809,4),o=l(o,r,n,i,e[12],3873151461,11),i=l(i,o,r,n,e[15],530742520,16),r=d(r,n=l(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=d(o,r,n,i,e[7],1126891415,10),i=d(i,o,r,n,e[14],2878612391,15),n=d(n,i,o,r,e[5],4237533241,21),r=d(r,n,i,o,e[12],1700485571,6),o=d(o,r,n,i,e[3],2399980690,10),i=d(i,o,r,n,e[10],4293915773,15),n=d(n,i,o,r,e[1],2240044497,21),r=d(r,n,i,o,e[8],1873313359,6),o=d(o,r,n,i,e[15],4264355552,10),i=d(i,o,r,n,e[6],2734768916,15),n=d(n,i,o,r,e[13],1309151649,21),r=d(r,n,i,o,e[4],4149444226,6),o=d(o,r,n,i,e[11],3174756917,10),i=d(i,o,r,n,e[2],718787259,15),n=d(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){e.exports=i;var n=r(59).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(60),i.Writable=r(173),i.Duplex=r(174),i.Transform=r(175),i.PassThrough=r(176),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a,s;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function l(){for(var e=[],t=0;t0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=b(u,c);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t,r){(t=e.exports=r(84)).Stream=t,t.Readable=t,t.Writable=r(61),t.Duplex=r(23),t.Transform=r(87),t.PassThrough=r(172)},function(e,t,r){"use strict";(function(t,n,i){var o=r(36);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;v.WritableState=y;var c=r(31);c.inherits=r(2);var f={deprecate:r(171)},l=r(85),d=r(3).Buffer,h=i.Uint8Array||function(){};var p,b=r(86);function m(){}function y(e,t){s=s||r(23),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=E(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||r(23),!(p.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function g(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,g(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(g(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)}))}function k(e,t){var r=E(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(v,l),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===v&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(17),r(169).setImmediate,r(9))},function(e,t,r){"use strict";var n=r(3).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(8).Buffer,i=r(2),o=r(83),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(h,o),h.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,w=0|this._a,_=0|this._b,E=0|this._c,S=0|this._d,k=0|this._e,T=0;T<80;T+=1){var x,M;T<16?(x=b(r,n,i,o,h,e[s[T]],l[0],c[T]),M=g(w,_,E,S,k,e[u[T]],d[0],f[T])):T<32?(x=m(r,n,i,o,h,e[s[T]],l[1],c[T]),M=v(w,_,E,S,k,e[u[T]],d[1],f[T])):T<48?(x=y(r,n,i,o,h,e[s[T]],l[2],c[T]),M=y(w,_,E,S,k,e[u[T]],d[2],f[T])):T<64?(x=v(r,n,i,o,h,e[s[T]],l[3],c[T]),M=m(w,_,E,S,k,e[u[T]],d[3],f[T])):(x=g(r,n,i,o,h,e[s[T]],l[4],c[T]),M=b(w,_,E,S,k,e[u[T]],d[4],f[T])),r=h,h=o,o=p(i,10),i=n,n=x,w=k,k=S,S=p(E,10),E=_,_=M}var C=this._b+i+S|0;this._b=this._c+o+k|0,this._c=this._d+h+w|0,this._d=this._e+r+_|0,this._e=this._a+n+E|0,this._a=C},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(177),t.sha1=r(178),t.sha224=r(179),t.sha256=r(88),t.sha384=r(180),t.sha512=r(89)},function(e,t,r){"use strict";t.utils=r(186),t.Cipher=r(187),t.DES=r(188),t.CBC=r(189),t.EDE=r(190)},function(e,t,r){var n=r(191),i=r(199),o=r(99);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(192),CBC:r(193),CFB:r(194),CFB8:r(195),CFB1:r(196),OFB:r(197),CTR:r(97),GCM:r(97)},i=r(99);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(8).Buffer)},function(e,t,r){"use strict";var n=t;n.version=r(209).version,n.utils=r(13),n.rand=r(68),n.curve=r(105),n.curves=r(71),n.ec=r(220),n.eddsa=r(224)},function(e,t,r){"use strict";var n,i=t,o=r(72),a=r(105),s=r(13).assert;function u(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(219)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){var n=t;n.utils=r(15),n.common=r(33),n.sha=r(213),n.ripemd=r(217),n.hmac=r(218),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){e.exports=r(252)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addToCart=void 0;a(r(11));var n=a(r(20)),i=r(130),o=r(26);function a(e){return e&&e.__esModule?e:{default:e}}t.addToCart=function(e,t){return(0,i.fireActionTriggerCustomEvent)(t,{detail:{linkName:t.getAttribute("data-link-name"),action:t.getAttribute("data-track-action")}}),function(t){return t({type:"REQUEST_ADD_TO_CART"}),n.default.post("cart",function(e){if(localStorage.getItem("guest"))return{id:e,guestKey:localStorage.getItem("guest")}}(e)).then((function(e){return e})).then((function(e){t({type:"RECEIVE_ADD_TO_CART",payload:e.data}),t((0,o.fetchCart)())}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addToWishlist=void 0;a(r(11));var n=a(r(20)),i=r(41),o=r(130);function a(e){return e&&e.__esModule?e:{default:e}}t.addToWishlist=function(e,t){return(0,o.fireActionTriggerCustomEvent)(t,{detail:{linkName:t.getAttribute("data-link-name"),action:t.getAttribute("data-track-action")}}),function(t){return t({type:"REQUEST_ADD_TO_WL"}),n.default.post("wishlist",function(e){if(localStorage.getItem("guest"))return{id:e,guestKey:localStorage.getItem("guest")}}(e)).then((function(e){return e})).then((function(e){t({type:"RECEIVE_ADD_TO_WL",payload:e.data}),t((0,i.fetchWishlist)())}))}}},function(e,t,r){"use strict";e.exports=r(144)},function(e,t,r){"use strict";var n=r(76),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?a:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0};var c=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=h(r);i&&i!==p&&e(t,i,n)}var a=f(r);l&&(a=a.concat(l(r)));for(var s=u(t),b=u(r),m=0;m0&&void 0!==arguments[0]?arguments[0]:o,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.type,a=t.payload;if(r===i)return n({},e,{locationBeforeTransitions:a});return e};var i=t.LOCATION_CHANGE="@@router/LOCATION_CHANGE",o={locationBeforeTransitions:null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=t.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD";function i(e){return function(){for(var t=arguments.length,r=Array(t),i=0;i=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(36);e.exports=g;var o,a=r(165);g.ReadableState=v;r(59).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=r(85),c=r(3).Buffer,f=t.Uint8Array||function(){};var l=r(31);l.inherits=r(2);var d=r(166),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,b=r(167),m=r(86);l.inherits(g,u);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var n=t instanceof(o=o||r(23));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(62).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function g(e){if(o=o||r(23),!(this instanceof g))return new g(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,k(e)}(e,a)):(i||(o=function(e,t){var r;n=t,c.isBuffer(n)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=E?e=E:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(T,e):T(e))}function T(e){h("emit readable"),e.emit("readable"),P(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(M,e,t))}function M(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function R(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):k(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&R(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&R(this)),null!==n&&this.emit("data",n),n},g.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,h("pipe count=%d opts=%j",o.pipesCount,t);var u=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?f:g;function c(t,n){h("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",m),e.removeListener("unpipe",c),r.removeListener("end",f),r.removeListener("end",g),r.removeListener("data",b),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function f(){h("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",c);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(r);e.on("drain",l);var d=!1;var p=!1;function b(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function m(t){h("onerror",t),g(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",v),g()}function v(){h("onfinish"),e.removeListener("close",y),g()}function g(){h("unpipe"),r.unpipe(e)}return r.on("data",b),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",m),e.once("close",y),e.once("finish",v),e.emit("pipe",r),o.flowing||(h("pipe resume"),r.resume()),e},g.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,y=0;y<16;++y)r[y]=e.readInt32BE(4*y);for(;y<64;++y)r[y]=0|(((t=r[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[y-7]+h(r[y-15])+r[y-16];for(var v=0;v<64;++v){var g=m+d(u)+c(u,p,b)+a[v]+r[v]|0,w=l(n)+f(n,i,o)|0;m=b,b=p,p=u,u=s+g|0,s=o,o=i,i=n,n=g+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(2),i=r(28),o=r(3).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,g=0|this._hh,w=0|this._al,_=0|this._bl,E=0|this._cl,S=0|this._dl,k=0|this._el,T=0|this._fl,x=0|this._gl,M=0|this._hl,C=0;C<32;C+=2)t[C]=e.readInt32BE(4*C),t[C+1]=e.readInt32BE(4*C+4);for(;C<160;C+=2){var O=t[C-30],P=t[C-30+1],A=h(O,P),R=p(P,O),j=b(O=t[C-4],P=t[C-4+1]),I=m(P,O),N=t[C-14],L=t[C-14+1],B=t[C-32],D=t[C-32+1],U=R+L|0,z=A+N+y(U,R)|0;z=(z=z+j+y(U=U+I|0,I)|0)+B+y(U=U+D|0,D)|0,t[C]=z,t[C+1]=U}for(var F=0;F<160;F+=2){z=t[F],U=t[F+1];var q=f(r,n,i),H=f(w,_,E),W=l(r,w),V=l(w,r),K=d(s,k),Y=d(k,s),G=a[F],$=a[F+1],X=c(s,u,v),Q=c(k,T,x),J=M+Y|0,Z=g+K+y(J,M)|0;Z=(Z=(Z=Z+X+y(J=J+Q|0,Q)|0)+G+y(J=J+$|0,$)|0)+z+y(J=J+U|0,U)|0;var ee=V+H|0,te=W+q+y(ee,V)|0;g=v,M=x,v=u,x=T,u=s,T=k,s=o+Z+y(k=S+J|0,S)|0,o=i,S=E,i=n,E=_,n=r,_=w,r=Z+te+y(w=J+ee|0,J)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+E|0,this._dl=this._dl+S|0,this._el=this._el+k|0,this._fl=this._fl+T|0,this._gl=this._gl+x|0,this._hl=this._hl+M|0,this._ah=this._ah+r+y(this._al,w)|0,this._bh=this._bh+n+y(this._bl,_)|0,this._ch=this._ch+i+y(this._cl,E)|0,this._dh=this._dh+o+y(this._dl,S)|0,this._eh=this._eh+s+y(this._el,k)|0,this._fh=this._fh+u+y(this._fl,T)|0,this._gh=this._gh+v+y(this._gl,x)|0,this._hh=this._hh+g+y(this._hl,M)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";var n=r(2),i=r(181),o=r(19),a=r(3).Buffer,s=r(91),u=r(63),c=r(64),f=a.alloc(128);function l(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(8).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(17))},function(e,t,r){var n=r(91),i=r(63),o=r(64),a=r(94),s=r(95),u=r(3).Buffer,c=u.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(f).cmp(l);)r.iadd(h)}else for(;r.mod(o).cmp(d);)r.iadd(h);if(m(p=r.shrn(1))&&m(r)&&y(p)&&y(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(6),i=r(68);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),f=s.toRed(o);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var d=l.toRed(o).redPow(c);if(0!==d.cmp(a)&&0!==d.cmp(f)){for(var h=1;h0;t--){var f=this._randrange(new n(2),a),l=e.gcd(f);if(0!==l.cmpn(1))return l;var d=f.toRed(i).redPow(u);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var h=1;h>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(39),n.short=r(210),n.mont=r(211),n.edwards=r(212)},function(e,t,r){"use strict";var n=r(15).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(15),i=r(33),o=r(106),a=r(12),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,l=o.maj32,d=o.s0_256,h=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,c=n.length;c>=256;c>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;c=1+u;for(var f=n.length;f>0;c--,f>>=8)o[c]=255&f;return this._createEncoderBuffer([o,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[f(n.getFullYear()),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[f(n.getFullYear()%100),f(n.getUTCMonth()+1),f(n.getUTCDate()),f(n.getUTCHours()),f(n.getUTCMinutes()),f(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n0?o.default.createElement(d.Link,{to:"checkout",className:"btn btn-primary btn-lg",onClick:this.props.closePopover},"Checkout your order"):"";return o.default.createElement("div",null,o.default.createElement(s.default,{title:"My Cart"}),o.default.createElement("section",{className:"section"},o.default.createElement("div",{className:"container"},o.default.createElement("table",{className:"table"},o.default.createElement("thead",null,o.default.createElement("tr",null,o.default.createElement("th",null,o.default.createElement("abbr",null,"ID")),o.default.createElement("th",null,o.default.createElement("abbr",null,"Title")),o.default.createElement("th",null,"Price"),o.default.createElement("th",null," "))),o.default.createElement("tfoot",null,o.default.createElement("tr",null,o.default.createElement("th",null," "),o.default.createElement("th",null," "),o.default.createElement("th",null,"Total: $",t),o.default.createElement("th",null," "))),o.default.createElement("tbody",null,Object.keys(this.props.cart).map((function(t){return o.default.createElement(l.default,{key:t,productKey:t,handleTrash:e.handleTrash.bind(e),product:e.getItemById(e.props.cart[t].id)})})))),r)))}}]),t}(i.Component);t.default=(0,a.connect)((function(e){return{cart:e.CartReducer.data,products:e.ProductsReducer.data}}))(p)},function(e,t){t.__esModule=!0;t.ATTRIBUTE_NAMES={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"};var r=t.TAG_NAMES={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},n=(t.VALID_TAG_NAMES=Object.keys(r).map((function(e){return r[e]})),t.TAG_PROPERTIES={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src"},t.REACT_TAG_MAP={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"});t.HELMET_PROPS={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},t.HTML_TAG_MAP=Object.keys(n).reduce((function(e,t){return e[n[t]]=t,e}),{}),t.SELF_CLOSING_TAGS=[r.NOSCRIPT,r.SCRIPT,r.STYLE],t.HELMET_ATTRIBUTE="data-react-helmet"},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(o)})),e.exports=u}).call(this,r(17))},function(e,t,r){"use strict";var n=r(10),i=r(259),o=r(120),a=r(261),s=r(262),u=r(124);e.exports=function(e){return new Promise((function(t,c){var f=e.data,l=e.headers;n.isFormData(f)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",p=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+p)}if(d.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,n={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};i(t,c,n),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var b=r(263),m=(e.withCredentials||s(e.url))&&e.xsrfCookieName?b.read(e.xsrfCookieName):void 0;m&&(l[e.xsrfHeaderName]=m)}if("setRequestHeader"in d&&n.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),c(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,r){"use strict";var n=r(260);e.exports=function(e,t,r,i,o){var a=new Error(e);return n(a,t,r,i,o)}},function(e,t,r){"use strict";var n=r(10);e.exports=function(e,t){t=t||{};var r={};return n.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(r[e]=t[e])})),n.forEach(["headers","auth","proxy"],(function(i){n.isObject(t[i])?r[i]=n.deepMerge(e[i],t[i]):void 0!==t[i]?r[i]=t[i]:n.isObject(e[i])?r[i]=n.deepMerge(e[i]):void 0!==e[i]&&(r[i]=e[i])})),n.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r}},function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r collection.forEach(iteratee); - const baseEach = (iteratee, collection) => { arrayEach(key => iteratee(collection[key], key), keys(collection)); }; - const arrayFilter = (predicate, collection) => collection.filter(predicate); const baseFilter = (predicate, collection) => { const result = {}; @@ -199,22 +206,20 @@ window.adobe.target = (function () { if (isNil(collection)) { return []; } - const func = isArray(collection) ? arrayFilter : baseFilter; + const func = isArray$1(collection) ? arrayFilter : baseFilter; return func(castFunction(predicate), collection); } - function first(array) { return array && array.length ? array[0] : undefined; } - function flatten(array) { if (isNil(array)) { return []; } return [].concat.apply([], array); } - function flow(funcs) { + var _this = this; const length = funcs ? funcs.length : 0; let index = length; while (index -= 1) { @@ -222,34 +227,33 @@ window.adobe.target = (function () { throw new TypeError("Expected a function"); } } - return (...args) => { + return function () { let i = 0; - let result = length ? funcs[i].apply(this, args) : args[0]; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + let result = length ? funcs[i].apply(_this, args) : args[0]; while ((i += 1) < length) { - result = funcs[i].call(this, result); + result = funcs[i].call(_this, result); } return result; }; } - function forEach(iteratee, collection) { if (isNil(collection)) { return; } - const func = isArray(collection) ? arrayEach : baseEach; + const func = isArray$1(collection) ? arrayEach : baseEach; func(castFunction(iteratee), collection); } - function isObjectLike(value) { const notNull = value != null; return notNull && typeof value === "object"; } - const stringTag = "[object String]"; function isString(value) { - return typeof value === "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) === stringTag; + return typeof value === "string" || !isArray$1(value) && isObjectLike(value) && baseGetTag(value) === stringTag; } - function hash(string) { if (!isString(string)) { return -1; @@ -263,18 +267,14 @@ window.adobe.target = (function () { } return result; } - const MAX_SAFE_INTEGER = 9007199254740991; function isLength(value) { return typeof value === "number" && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; } - function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } - const arrayMap = (iteratee, collection) => collection.map(iteratee); - function baseValues(props, object) { return arrayMap(key => object[key], props); } @@ -302,12 +302,10 @@ window.adobe.target = (function () { } return baseValues(keys(value), value); } - function includes(value, collection) { const coll = isArrayLike(collection) ? collection : toArray(collection); return coll.indexOf(value) > -1; } - const { prototype: objectProto$1 } = Object; @@ -318,7 +316,7 @@ window.adobe.target = (function () { if (value == null) { return true; } - if (isArrayLike(value) && (isArray(value) || isString(value) || isFunction(value.splice))) { + if (isArrayLike(value) && (isArray$1(value) || isString(value) || isFunction(value.splice))) { return !value.length; } for (const key in value) { @@ -328,7 +326,6 @@ window.adobe.target = (function () { } return true; } - const { prototype: stringProto } = String; @@ -338,18 +335,14 @@ window.adobe.target = (function () { function trim(string) { return isNil(string) ? "" : nativeStringTrim.call(string); } - function isBlank(value) { return isString(value) ? !trim(value) : isEmpty(value); } - const isNotBlank = value => !isBlank(value); - const numberTag = "[object Number]"; function isNumber(value) { return typeof value === "number" || isObjectLike(value) && baseGetTag(value) === numberTag; } - const objectTag = "[object Object]"; const { prototype: funcProto @@ -361,7 +354,7 @@ window.adobe.target = (function () { toString: funcToString } = funcProto; const { - hasOwnProperty: hasOwnProperty$2 + hasOwnProperty: hasOwnProperty$1$1 } = objectProto$2; const objectCtorString = funcToString.call(Object); function getPrototype(value) { @@ -375,17 +368,15 @@ window.adobe.target = (function () { if (proto === null) { return true; } - const Ctor = hasOwnProperty$2.call(proto, "constructor") && proto.constructor; + const Ctor = hasOwnProperty$1$1.call(proto, "constructor") && proto.constructor; return typeof Ctor === "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; } - function join(joiner, collection) { - if (!isArray(collection)) { + if (!isArray$1(collection)) { return ""; } return collection.join(joiner || ""); } - const baseMap = (iteratee, collection) => { const result = {}; baseEach((value, key) => { @@ -397,14 +388,12 @@ window.adobe.target = (function () { if (isNil(collection)) { return []; } - const func = isArray(collection) ? arrayMap : baseMap; + const func = isArray$1(collection) ? arrayMap : baseMap; return func(castFunction(iteratee), collection); } - function now() { return new Date().getTime(); } - const arrayReduce = (iteratee, accumulator, collection) => collection.reduce(iteratee, accumulator); const baseReduce = (iteratee, accumulator, collection) => { let localAcc = accumulator; @@ -417,10 +406,9 @@ window.adobe.target = (function () { if (isNil(collection)) { return accumulator; } - const func = isArray(collection) ? arrayReduce : baseReduce; + const func = isArray$1(collection) ? arrayReduce : baseReduce; return func(castFunction(iteratee), accumulator, collection); } - const { prototype: arrayProto } = Array; @@ -430,41 +418,47 @@ window.adobe.target = (function () { function reverse(array) { return array == null ? array : nativeReverse.call(array); } - function split(separator, string) { if (isBlank(string)) { return []; } return string.split(separator || ""); } - - function random(lower, upper) { - return lower + Math.floor(Math.random() * (upper - lower + 1)); - } - function uuid() { - let d = now(); - return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, c => { - const r = (d + random(0, 16)) % 16 | 0; - d = Math.floor(d / 16); - return (c === "x" ? r : r & 0x3 | 0x8).toString(16); - }); - } - function values(obj) { if (obj === null || typeof obj !== "object") { return []; } return Object.keys(obj).map(key => obj[key]); } - - function delay(func, wait = 0) { + function delay(func) { + let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; return setTimeout(func, Number(wait) || 0); } function cancelDelay(id) { clearTimeout(id); } - - function _defineProperty(obj, key, value) { + function ownKeys$1(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread2$1(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { + _defineProperty$1(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, @@ -475,56 +469,24 @@ window.adobe.target = (function () { } else { obj[key] = value; } - return obj; } - - function ownKeys(object, enumerableOnly) { - var keys = Object.keys(object); - - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - if (enumerableOnly) symbols = symbols.filter(function (sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - }); - keys.push.apply(keys, symbols); - } - - return keys; - } - - function _objectSpread2(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i] != null ? arguments[i] : {}; - - if (i % 2) { - ownKeys(Object(source), true).forEach(function (key) { - _defineProperty(target, key, source[key]); - }); - } else if (Object.getOwnPropertyDescriptors) { - Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); - } else { - ownKeys(Object(source)).forEach(function (key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - } - - return target; - } - const DECISIONING_METHOD = { ON_DEVICE: "on-device", SERVER_SIDE: "server-side", HYBRID: "hybrid" }; - + const EXECUTION_MODE = { + EDGE: "edge", + LOCAL: "local" + }; const AT_PREFIX = "AT:"; const NOOP_LOGGER = { - debug(...messages) {}, - error(...messages) {} + debug() {}, + error() {} }; - function getLogger(logger = {}) { + function getLogger() { + let logger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; if (logger.built) { return logger; } @@ -536,20 +498,25 @@ window.adobe.target = (function () { built: true }, NOOP_LOGGER); if (isFunction(debug)) { - targetLogger.debug = (...messages) => { + targetLogger.debug = function () { + for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) { + messages[_key] = arguments[_key]; + } logger.debug.apply(null, [AT_PREFIX, ...messages]); }; } if (isFunction(error)) { - targetLogger.error = (...messages) => { + targetLogger.error = function () { + for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + messages[_key2] = arguments[_key2]; + } logger.error.apply(null, [AT_PREFIX, ...messages]); }; } return targetLogger; } - const DECISIONING_ENGINE_NOT_READY = "Unable to fulfill request; decisioning engine not ready."; - + const NOTIFICATIONS_REQUIRED$1 = "Notifications array is required in request"; const DEFAULT_GLOBAL_MBOX = "target-global-mbox"; const DEFAULT_NUM_FETCH_RETRIES = 10; const ChannelType = { @@ -570,8 +537,7 @@ window.adobe.target = (function () { const ENVIRONMENT_DEV = "development"; const POSSIBLE_ENVIRONMENTS = [ENVIRONMENT_PROD, ENVIRONMENT_STAGE, ENVIRONMENT_DEV]; const UNKNOWN_IP_ADDRESS = "unknownIpAddress"; - - const VIEWS = "views"; + const VIEWS$1 = "views"; const MBOXES = "mboxes"; function isUndefined(value) { return typeof value === "undefined"; @@ -579,10 +545,19 @@ window.adobe.target = (function () { function isDefined(value) { return !isUndefined(value); } + function isPojo(obj) { + if (isUndefined(obj) || obj === null || !isObject(obj)) { + return false; + } + return Object.getPrototypeOf(obj) === Object.prototype; + } function getNamesForRequested(itemsKey, deliveryRequest) { const resultSet = new Set(); ["prefetch", "execute"].forEach(type => { - const items = deliveryRequest && deliveryRequest[type] && deliveryRequest[type][itemsKey] instanceof Array ? deliveryRequest[type][itemsKey] : []; + if (!deliveryRequest || !deliveryRequest[type]) { + return; + } + const items = deliveryRequest[type][itemsKey] instanceof Array ? deliveryRequest[type][itemsKey] : []; items.filter(item => isDefined(item.name)).forEach(item => { resultSet.add(item.name); }); @@ -593,7 +568,7 @@ window.adobe.target = (function () { return getNamesForRequested(MBOXES, deliveryRequest); } function getViewNames(deliveryRequest) { - return getNamesForRequested(VIEWS, deliveryRequest); + return getNamesForRequested(VIEWS$1, deliveryRequest); } function hasRequested(itemsKey, deliveryRequest) { const types = ["prefetch", "execute"]; @@ -607,7 +582,7 @@ window.adobe.target = (function () { return false; } function hasRequestedViews(deliveryRequest) { - return hasRequested(VIEWS, deliveryRequest); + return hasRequested(VIEWS$1, deliveryRequest); } function isBrowser() { return typeof window !== "undefined"; @@ -615,13 +590,13 @@ window.adobe.target = (function () { function isNodeJS() { return typeof global !== "undefined"; } - const noop = () => undefined; + const noop$1 = () => undefined; const noopPromise = value => Promise.resolve(value); function requiresDecisioningEngine(decisioningMethod) { return includes(decisioningMethod, [DECISIONING_METHOD.ON_DEVICE, DECISIONING_METHOD.HYBRID]); } function objectWithoutUndefinedValues(obj) { - const result = _objectSpread2({}, obj); + const result = _objectSpread2$1({}, obj); Object.keys(result).forEach(key => { if (isUndefined(result[key])) { delete result[key]; @@ -629,9 +604,10 @@ window.adobe.target = (function () { }); return result; } - function getPropertyToken(property = { - token: undefined - }) { + function getPropertyToken$1() { + let property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + token: undefined + }; const { token = undefined } = property; @@ -641,9 +617,13 @@ window.adobe.target = (function () { const IP_ADDRESS = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/g; return isString(ipAddress) && IP_ADDRESS.test(ipAddress); } - function memoize(func, keyResolverFunc = arr => arr[0]) { + function memoize(func) { + let keyResolverFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : arr => arr[0]; const memoizedValues = {}; - return function memoized(...funcArgs) { + return function memoized() { + for (var _len = arguments.length, funcArgs = new Array(_len), _key = 0; _key < _len; _key++) { + funcArgs[_key] = arguments[_key]; + } const key = keyResolverFunc.call(this, funcArgs); if (!isDefined(memoizedValues[key])) { memoizedValues[key] = func.call(null, ...funcArgs); @@ -651,8 +631,29 @@ window.adobe.target = (function () { return memoizedValues[key]; }; } - - const NOT_MODIFIED = 304; + function isExecutePageLoad(request) { + return !!request.execute && !!request.execute.pageLoad; + } + function executeMboxCount(request) { + return !!request.execute && !!request.execute.mboxes && request.execute.mboxes.length || 0; + } + function isPrefetchPageLoad(request) { + return !!request.prefetch && !!request.prefetch.pageLoad; + } + function prefetchMboxCount(request) { + return !!request.prefetch && !!request.prefetch.mboxes && request.prefetch.mboxes.length || 0; + } + function prefetchViewCount(request) { + return !!request.prefetch && !!request.prefetch.views && request.prefetch.views.length || 0; + } + function formatDecimal(value) { + let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; + if (!value || !isNumber(value)) { + return undefined; + } + return +value.toFixed(digits); + } + const NOT_MODIFIED$1 = 304; function getFetchApi(fetchApi) { if (isFunction(fetchApi)) { return fetchApi; @@ -666,10 +667,14 @@ window.adobe.target = (function () { } return api; } - function getFetchWithRetry(fetchApi, maxRetries = DEFAULT_NUM_FETCH_RETRIES, errorFunc = errorMessage => errorMessage, incidentalFailureCallback = noop) { - return function fetchWithRetry(url, options, numRetries = maxRetries) { + function getFetchWithRetry(fetchApi) { + let maxRetries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_NUM_FETCH_RETRIES; + let errorFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : errorMessage => errorMessage; + let incidentalFailureCallback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop$1; + return function fetchWithRetry(url, options) { + let numRetries = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : maxRetries; return fetchApi(url, options).then(res => { - if (!res.ok && res.status !== NOT_MODIFIED) { + if (!res.ok && res.status !== NOT_MODIFIED$1) { throw Error(res.statusText); } return res; @@ -684,7 +689,171 @@ window.adobe.target = (function () { }); }; } - + function InMemoryTelemetryStore() { + let telemetryEntries = []; + function addEntry(entry) { + telemetryEntries.push(entry); + } + function getAndClearEntries() { + const allEntries = telemetryEntries; + telemetryEntries = []; + return allEntries; + } + function hasEntries() { + return telemetryEntries.length > 0; + } + return { + addEntry, + getAndClearEntries, + hasEntries + }; + } + const STATUS_OK = 200; + function TelemetryProvider() { + let telemetryEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DECISIONING_METHOD.SERVER_SIDE; + let telemetryStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : InMemoryTelemetryStore(); + function getMode(status, decisioningMethod) { + if (status === STATUS_OK && (decisioningMethod === DECISIONING_METHOD.ON_DEVICE || decisioningMethod === DECISIONING_METHOD.HYBRID)) { + return EXECUTION_MODE.LOCAL; + } + return EXECUTION_MODE.EDGE; + } + function getFeatures(request) { + const features = {}; + const executePageLoad = isExecutePageLoad(request); + const executeMbox = executeMboxCount(request); + const prefetchPageLoad = isPrefetchPageLoad(request); + const prefetchMbox = prefetchMboxCount(request); + const prefetchView = prefetchViewCount(request); + if (executePageLoad) { + features.executePageLoad = executePageLoad; + } + if (executeMbox) { + features.executeMboxCount = executeMbox; + } + if (prefetchPageLoad) { + features.prefetchPageLoad = prefetchPageLoad; + } + if (prefetchMbox) { + features.prefetchMboxCount = prefetchMbox; + } + if (prefetchView) { + features.prefetchViewCount = prefetchView; + } + return features; + } + function normalizeEntryRequest(entryRequest) { + const normalized = {}; + if (entryRequest.dns) { + normalized.dns = formatDecimal(entryRequest.dns); + } + if (entryRequest.tls) { + normalized.tls = formatDecimal(entryRequest.tls); + } + if (entryRequest.timeToFirstByte) { + normalized.timeToFirstByte = formatDecimal(entryRequest.timeToFirstByte); + } + if (entryRequest.download) { + normalized.download = formatDecimal(entryRequest.download); + } + if (entryRequest.responseSize) { + normalized.responseSize = formatDecimal(entryRequest.responseSize); + } + return normalized; + } + function normalizeEntry(entry) { + const normalized = {}; + if (entry.execution) { + normalized.execution = formatDecimal(entry.execution); + } + if (entry.parsing) { + normalized.parsing = formatDecimal(entry.parsing); + } + if (entry.request) { + normalized.request = normalizeEntryRequest(entry.request); + } + return reactorObjectAssign(entry, normalized); + } + function normalizeAndAddEntry(entry) { + telemetryStore.addEntry(normalizeEntry(entry)); + } + function addServerStateEntry(request) { + if (!telemetryEnabled) { + return; + } + normalizeAndAddEntry({ + requestId: request.requestId, + timestamp: now() + }); + } + function addRenderEntry(renderId, execution) { + if (!telemetryEnabled) { + return; + } + normalizeAndAddEntry({ + requestId: renderId, + timestamp: now(), + execution + }); + } + function addRequestEntry(requestId, entry) { + const requestEntry = reactorObjectAssign(entry, { + requestId, + timestamp: now() + }); + normalizeAndAddEntry(requestEntry); + } + function addArtifactRequestEntry(requestId, entry) { + if (!telemetryEnabled || !entry) { + return; + } + addRequestEntry(requestId, entry); + } + function addDeliveryRequestEntry(request, entry, status) { + let decisioningMethod = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : method; + if (!telemetryEnabled || !entry) { + return; + } + const { + requestId + } = request; + const features = reactorObjectAssign(getFeatures(request), { + decisioningMethod + }); + const baseEntry = { + mode: getMode(status, decisioningMethod), + features + }; + const deliveryRequestEntry = reactorObjectAssign(entry, baseEntry); + addRequestEntry(requestId, deliveryRequestEntry); + } + function getAndClearEntries() { + return telemetryStore.getAndClearEntries(); + } + function hasEntries() { + return telemetryStore.hasEntries(); + } + function addTelemetryToDeliveryRequest(deliveryRequest) { + if (hasEntries()) { + return reactorObjectAssign(deliveryRequest, { + telemetry: { + entries: getAndClearEntries() + } + }); + } + return deliveryRequest; + } + return { + addDeliveryRequestEntry, + addArtifactRequestEntry, + addRenderEntry, + addServerStateEntry, + getAndClearEntries, + hasEntries, + addTelemetryToDeliveryRequest + }; + } function matchUserAgent(matchersList, processFunc) { processFunc = typeof processFunc === "function" ? processFunc : matcher => matcher.name; return function checkMatches(userAgent) { @@ -700,43 +869,46 @@ window.adobe.target = (function () { }); }; } - const browserFromUserAgent = (userAgent = "") => matchUserAgent([{ - name: "Edge", - regex: /(edge|edgios|edga|edg)\/((\d+)?[\w.]+)/i, - versionGroupIndex: 2 - }, { - name: "Mobile Safari", - regex: /version\/([\w.]+).+?mobile\/\w+\s(safari)/i, - versionGroupIndex: 1 - }, { - name: "Safari", - regex: /version\/([\w.]+).+?(mobile\s?safari|safari)/i, - versionGroupIndex: 1 - }, { - name: "Chrome", - regex: /(chrome)\/v?([\w.]+)/i, - versionGroupIndex: 2 - }, { - name: "Firefox", - regex: /(firefox)\/([\w.-]+)$/i, - versionGroupIndex: 2 - }, { - name: "IE", - regex: /(?:ms|\()(ie)\s([\w.]+)/i, - versionGroupIndex: 2 - }, { - name: "IE", - regex: /(trident).+rv[:\s]([\w.]+).+like\sgecko/i, - versionGroupIndex: 2, - version: 11 - }], (matcher, matches) => { - const version = (matches && matches.length > matcher.versionGroupIndex ? matches[matcher.versionGroupIndex] : matcher.version) || "-1"; - const majorVersion = typeof version === "string" ? parseInt(version.split(".")[0], 10) : -1; - return { - name: matcher.name, - version: majorVersion - }; - })(userAgent); + const browserFromUserAgent = function () { + let userAgent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + return matchUserAgent([{ + name: "Edge", + regex: /(edge|edgios|edga|edg)\/((\d+)?[\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "Mobile Safari", + regex: /version\/([\w.]+).+?mobile\/\w+\s(safari)/i, + versionGroupIndex: 1 + }, { + name: "Safari", + regex: /version\/([\w.]+).+?(mobile\s?safari|safari)/i, + versionGroupIndex: 1 + }, { + name: "Chrome", + regex: /(chrome)\/v?([\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "Firefox", + regex: /(firefox)\/([\w.-]+)$/i, + versionGroupIndex: 2 + }, { + name: "IE", + regex: /(?:ms|\()(ie)\s([\w.]+)/i, + versionGroupIndex: 2 + }, { + name: "IE", + regex: /(trident).+rv[:\s]([\w.]+).+like\sgecko/i, + versionGroupIndex: 2, + version: 11 + }], (matcher, matches) => { + const version = (matches && matches.length > matcher.versionGroupIndex ? matches[matcher.versionGroupIndex] : matcher.version) || "-1"; + const majorVersion = typeof version === "string" ? parseInt(version.split(".")[0], 10) : -1; + return { + name: matcher.name, + version: majorVersion + }; + })(userAgent); + }; const operatingSystemFromUserAgent = userAgent => matchUserAgent([{ name: "iOS", regex: /iPhone|iPad|iPod/ @@ -756,13 +928,13 @@ window.adobe.target = (function () { name: "Mac OS", regex: /Macintosh;/ }])(userAgent); - function mul32(m, n) { const nlo = n & 0xffff; const nhi = n - nlo; return (nhi * m | 0) + (nlo * m | 0) | 0; } - function hashUnencodedCharsRaw(stringValue, seed = 0) { + function hashUnencodedCharsRaw(stringValue) { + let seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; let k1; const len = stringValue.length; const c1 = 0xcc9e2d51; @@ -794,17 +966,12 @@ window.adobe.target = (function () { return h1; } const hashUnencodedChars = memoize(hashUnencodedCharsRaw, arr => arr.join("-")); - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; + return module = { + exports: {} + }, fn(module, module.exports), module.exports; } - - function getCjsExportFromNamespace (n) { - return n && n['default'] || n; - } - var performanceNow = createCommonjsModule(function (module) { (function () { var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; @@ -838,7 +1005,6 @@ window.adobe.target = (function () { } }).call(commonjsGlobal); }); - function createPerfToolInstance() { let timingIds = {}; let startTimes = {}; @@ -848,14 +1014,16 @@ window.adobe.target = (function () { timingIds[id] = count; return "" + id + count; } - function timeStart(id, incrementTimer = false) { + function timeStart(id) { + let incrementTimer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; const timingId = incrementTimer ? getUniqueTimingId(id) : id; if (isUndefined(startTimes[timingId])) { startTimes[timingId] = performanceNow(); } return timingId; } - function timeEnd(id, offset = 0) { + function timeEnd(id) { + let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; if (isUndefined(startTimes[id])) { return -1; } @@ -863,6 +1031,11 @@ window.adobe.target = (function () { timings[id] = timing; return timing; } + function clearTiming(id) { + delete timingIds[id]; + delete startTimes[id]; + delete timings[id]; + } function reset() { timingIds = {}; startTimes = {}; @@ -873,11 +1046,11 @@ window.adobe.target = (function () { timeEnd, getTimings: () => timings, getTiming: key => timings[key], + clearTiming, reset }; } const perfTool = createPerfToolInstance(); - function parseURI(str, opts) { if (!str) return undefined; opts = opts || {}; @@ -902,7 +1075,40 @@ window.adobe.target = (function () { }); return uri; } - var parseUri = parseURI; + var parseUri$1 = parseURI; + function getRandomValues() { + const crypto = window.crypto || window.msCrypto; + return !isNil(crypto) && crypto.getRandomValues && isFunction(crypto.getRandomValues) && crypto.getRandomValues.bind(crypto); + } + const BUFFER = new Uint8Array(256); + const GET_RANDOM_VALUES = getRandomValues(); + function rng() { + return GET_RANDOM_VALUES(BUFFER); + } + function createByteToHex() { + const result = []; + for (let i = 0; i < 256; i += 1) { + result.push((i + 0x100).toString(16).substr(1)); + } + return result; + } + const BYTE_TO_HEX = createByteToHex(); + function stringify$1(arr) { + const result = []; + for (let i = 0; i < 16; i += 1) { + result.push(BYTE_TO_HEX[arr[i]]); + } + return join("", result).toLowerCase(); + } + function v4(rng) { + const buffer = rng(); + buffer[6] = buffer[6] & 0x0f | 0x40; + buffer[8] = buffer[8] & 0x3f | 0x80; + return stringify$1(buffer); + } + function uuid() { + return v4(rng); + } const TYPE = "type"; const CONTENT = "content"; @@ -974,8 +1180,8 @@ window.adobe.target = (function () { const ERROR_REQUIRED = "error option is required"; const OFFER_REQUIRED = "offer option is required"; const UNEXPECTED_ERROR = "Unexpected error"; - const REQUEST_FAILED = "request failed"; - const REQUEST_SUCCEEDED = "request succeeded"; + const REQUEST_FAILED$1 = "request failed"; + const REQUEST_SUCCEEDED$1 = "request succeeded"; const ACTION_RENDERED = "Action rendered successfully"; const ACTION_RENDERING = "Rendering action"; const EMPTY_CONTENT = "Action has no content"; @@ -1008,11 +1214,11 @@ window.adobe.target = (function () { const PARAMS = "params"; const ACTIONS = "actions"; const RESPONSE_TOKENS = "responseTokens"; - const DATA = "data"; + const DATA$1 = "data"; const RESPONSE = "response"; const REQUEST = "request"; const PROVIDER = "provider"; - const PAGE_LOAD = "pageLoad"; + const PAGE_LOAD$1 = "pageLoad"; const FLICKER_CONTROL_CLASS = "at-flicker-control"; const MARKER_CSS_CLASS = "at-element-marker"; const CLICK_TRACKING_CSS_CLASS = "at-element-click-tracking"; @@ -1020,7 +1226,7 @@ window.adobe.target = (function () { const CLIENT_CODE = "clientCode"; const IMS_ORG_ID = "imsOrgId"; const SERVER_DOMAIN = "serverDomain"; - const TIMEOUT = "timeout"; + const TIMEOUT$1 = "timeout"; const GLOBAL_MBOX_NAME = "globalMboxName"; const GLOBAL_MBOX_AUTO_CREATE = "globalMboxAutoCreate"; const VERSION = "version"; @@ -1065,7 +1271,7 @@ window.adobe.target = (function () { const PRIMARY = "primary"; const PAGE = "page"; const VIEW = "view"; - const VIEWS$1 = "views"; + const VIEWS = "views"; const OPTIONS = "options"; const METRICS = "metrics"; const EVENT_TOKEN = "eventToken"; @@ -1107,11 +1313,15 @@ window.adobe.target = (function () { const CDN_BASEPATH_SETTING = "cdnBasePath"; const WEB_CHANNEL = "web"; + var document$1 = document; + + var window$1 = window; + const FILE_PROTOCOL = "file:"; const IP_V4_REGEX = /^(?!0)(?!.*\.$)((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$/; const STANDARD_DOMAIN_REGEX = /^(com|edu|gov|net|mil|org|nom|co|name|info|biz)$/i; let config = {}; - const OVERRIDABLE_SETTINGS = [ENABLED, CLIENT_CODE, IMS_ORG_ID, SERVER_DOMAIN, COOKIE_DOMAIN, TIMEOUT, MBOX_PARAMS, GLOBAL_MBOX_PARAMS, DEFAULT_CONTENT_HIDDEN_STYLE, DEFAULT_CONTENT_VISIBLE_STYLE, DEVICE_ID_LIFETIME, BODY_HIDDEN_STYLE, BODY_HIDING_ENABLED, SELECTORS_POLLING_TIMEOUT, VISITOR_API_TIMEOUT, OVERRIDE_MBOX_EDGE_SERVER, OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT, OPTOUT_ENABLED, OPTIN_ENABLED, SECURE_ONLY, SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT, AUTHORING_SCRIPT_URL, URL_SIZE_LIMIT, ENDPOINT, PAGE_LOAD_ENABLED, VIEWS_ENABLED, ANALYTICS_LOGGING, SERVER_STATE, DECISIONING_METHOD_SETTING, POLLING_INTERVAL_SETTING, ARTIFACT_LOCATION_SETTING, ARTIFACT_FORMAT_SETTING, ARTIFACT_PAYLOAD_SETTING, TARGET_ENVIRONMENT_SETTING, CDN_ENVIRONMENT_SETTING, TELEMETRY_ENABLED_SETTING, CDN_BASEPATH_SETTING, CSP_SCRIPT_NONCE, CSP_STYLE_NONCE, GLOBAL_MBOX_NAME]; + const OVERRIDABLE_SETTINGS = [ENABLED, CLIENT_CODE, IMS_ORG_ID, SERVER_DOMAIN, COOKIE_DOMAIN, TIMEOUT$1, MBOX_PARAMS, GLOBAL_MBOX_PARAMS, DEFAULT_CONTENT_HIDDEN_STYLE, DEFAULT_CONTENT_VISIBLE_STYLE, DEVICE_ID_LIFETIME, BODY_HIDDEN_STYLE, BODY_HIDING_ENABLED, SELECTORS_POLLING_TIMEOUT, VISITOR_API_TIMEOUT, OVERRIDE_MBOX_EDGE_SERVER, OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT, OPTOUT_ENABLED, OPTIN_ENABLED, SECURE_ONLY, SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT, AUTHORING_SCRIPT_URL, URL_SIZE_LIMIT, ENDPOINT, PAGE_LOAD_ENABLED, VIEWS_ENABLED, ANALYTICS_LOGGING, SERVER_STATE, DECISIONING_METHOD_SETTING, POLLING_INTERVAL_SETTING, ARTIFACT_LOCATION_SETTING, ARTIFACT_FORMAT_SETTING, ARTIFACT_PAYLOAD_SETTING, TARGET_ENVIRONMENT_SETTING, CDN_ENVIRONMENT_SETTING, TELEMETRY_ENABLED_SETTING, CDN_BASEPATH_SETTING, CSP_SCRIPT_NONCE, CSP_STYLE_NONCE, GLOBAL_MBOX_NAME]; function overrideSettingsIfRequired(settings, globalSettings) { if (!settings[ENABLED]) { return; @@ -1167,8 +1377,8 @@ window.adobe.target = (function () { overrideSettingsIfRequired(settings, win[GLOBAL_SETTINGS] || {}); } function initConfig(settings) { - overrideFromGlobalSettings(window, document, settings); - const fileProtocol = window.location.protocol === FILE_PROTOCOL; + overrideFromGlobalSettings(window$1, document$1, settings); + const fileProtocol = window$1.location.protocol === FILE_PROTOCOL; config = reactorObjectAssign({}, settings); config[DEVICE_ID_LIFETIME] = settings[DEVICE_ID_LIFETIME] / 1000; config[SESSION_ID_LIFETIME] = settings[SESSION_ID_LIFETIME] / 1000; @@ -1178,7 +1388,16 @@ window.adobe.target = (function () { return config; } - var js_cookie = createCommonjsModule(function (module, exports) { + var js_cookie = {exports: {}}; + + /*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ + (function (module, exports) { (function (factory) { var registeredInModuleLoader; { @@ -1291,18 +1510,21 @@ window.adobe.target = (function () { } return init(function () {}); }); - }); + })(js_cookie); + var cookie = js_cookie.exports; var reactorCookie = { - get: js_cookie.get, - set: js_cookie.set, - remove: js_cookie.remove + get: cookie.get, + set: cookie.set, + remove: cookie.remove }; - function hasOwnProperty$3(obj, prop) { + var querystring$1 = {}; + + function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } - var decode = function (qs, sep, eq, options) { + var decode$1 = function (qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; var obj = {}; @@ -1335,7 +1557,7 @@ window.adobe.target = (function () { } k = decodeURIComponent(kstr); v = decodeURIComponent(vstr); - if (!hasOwnProperty$3(obj, k)) { + if (!hasOwnProperty(obj, k)) { obj[k] = v; } else if (Array.isArray(obj[k])) { obj[k].push(v); @@ -1358,7 +1580,7 @@ window.adobe.target = (function () { return ''; } }; - var encode = function (obj, sep, eq, name) { + var encode$1 = function (obj, sep, eq, name) { sep = sep || '&'; eq = eq || '='; if (obj === null) { @@ -1380,15 +1602,10 @@ window.adobe.target = (function () { return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); }; - var querystring = createCommonjsModule(function (module, exports) { - exports.decode = exports.parse = decode; - exports.encode = exports.stringify = encode; - }); - var querystring_1 = querystring.decode; - var querystring_2 = querystring.parse; - var querystring_3 = querystring.encode; - var querystring_4 = querystring.stringify; + querystring$1.decode = querystring$1.parse = decode$1; + querystring$1.encode = querystring$1.stringify = encode$1; + var querystring = querystring$1; var reactorQueryString = { parse: function (string) { if (typeof string === 'string') { @@ -1405,8 +1622,8 @@ window.adobe.target = (function () { parse, stringify } = reactorQueryString; - const ANCHOR = document.createElement("a"); - const CACHE = {}; + const ANCHOR = document$1.createElement("a"); + const CACHE$1 = {}; function parseQueryString(value) { try { return parse(value); @@ -1421,29 +1638,29 @@ window.adobe.target = (function () { return ""; } } - function decode$1(value) { + function decode(value) { try { return decodeURIComponent(value); } catch (e) { return value; } } - function encode$1(value) { + function encode(value) { try { return encodeURIComponent(value); } catch (e) { return value; } } - function parseUri$1(url) { - if (CACHE[url]) { - return CACHE[url]; + function parseUri(url) { + if (CACHE$1[url]) { + return CACHE$1[url]; } ANCHOR.href = url; - const parsedUri = parseUri(ANCHOR.href); + const parsedUri = parseUri$1(ANCHOR.href); parsedUri.queryKey = parseQueryString(parsedUri.query); - CACHE[url] = parsedUri; - return CACHE[url]; + CACHE$1[url] = parsedUri; + return CACHE$1[url]; } const { @@ -1467,7 +1684,7 @@ window.adobe.target = (function () { if (isNaN(parseInt(parts[2], 10))) { return null; } - return createCookie(decode$1(parts[0]), decode$1(parts[1]), Number(parts[2])); + return createCookie(decode(parts[0]), decode(parts[1]), Number(parts[2])); } function getInternalCookies(cookieValue) { if (isBlank(cookieValue)) { @@ -1491,7 +1708,7 @@ window.adobe.target = (function () { return isObject(cookie) ? cookie.value : ""; } function serialize(cookie) { - return join("#", [encode$1(cookie.name), encode$1(cookie.value), cookie.expires]); + return join("#", [encode(cookie.name), encode(cookie.value), cookie.expires]); } function getExpires(cookie) { return cookie.expires; @@ -1544,11 +1761,11 @@ window.adobe.target = (function () { const { referrer } = doc; - const parsedUri = parseUri$1(referrer); + const parsedUri = parseUri(referrer); const refParams = parsedUri.queryKey; return isNil(refParams) ? false : isNotBlank(refParams[name]); } - function exists(win, doc, name) { + function exists$2(win, doc, name) { return isCookiePresent(name) || isParamPresent(win, name) || isRefParamPresent(doc, name); } @@ -1568,7 +1785,7 @@ window.adobe.target = (function () { return result; } function isDeliveryDisabled() { - return exists(window, document, DISABLE); + return exists$2(window$1, document$1, DISABLE); } function isDeliveryEnabled() { const config = getConfig(); @@ -1576,10 +1793,10 @@ window.adobe.target = (function () { return enabled && isCookieEnabled() && !isDeliveryDisabled(); } function isDebugEnabled() { - return exists(window, document, DEBUG); + return exists$2(window$1, document$1, DEBUG); } function isAuthoringEnabled() { - return exists(window, document, AUTHORING); + return exists$2(window$1, document$1, AUTHORING); } const ADOBE_TARGET_PREFIX = "AT:"; @@ -1610,11 +1827,17 @@ window.adobe.target = (function () { } } - function logWarn(...args) { - warn(window, args); + function logWarn() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + warn(window$1, args); } - function logDebug(...args) { - debug(window, args); + function logDebug() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + debug(window$1, args); } const logger = { debug: logDebug, @@ -1662,13 +1885,13 @@ window.adobe.target = (function () { } function initTraces() { - initialize(window, getConfig(), isDebugEnabled()); + initialize(window$1, getConfig(), isDebugEnabled()); } function addServerTrace(trace) { - saveTrace(window, SERVER_TRACES, trace, isDebugEnabled()); + saveTrace(window$1, SERVER_TRACES, trace, isDebugEnabled()); } function addClientTrace(trace) { - saveTrace(window, CLIENT_TRACES, trace, isDebugEnabled()); + saveTrace(window$1, CLIENT_TRACES, trace, isDebugEnabled()); } function finallyConstructor(callback) { @@ -1685,17 +1908,17 @@ window.adobe.target = (function () { } var setTimeoutFunc = setTimeout; - function isArray$1(x) { + function isArray(x) { return Boolean(x && typeof x.length !== 'undefined'); } - function noop$1() {} + function noop() {} function bind(fn, thisArg) { return function () { fn.apply(thisArg, arguments); }; } - function Promise$1(fn) { - if (!(this instanceof Promise$1)) throw new TypeError('Promises must be constructed via new'); + function Promise$2(fn) { + if (!(this instanceof Promise$2)) throw new TypeError('Promises must be constructed via new'); if (typeof fn !== 'function') throw new TypeError('not a function'); this._state = 0; this._handled = false; @@ -1712,28 +1935,28 @@ window.adobe.target = (function () { return; } self._handled = true; - Promise$1._immediateFn(function () { + Promise$2._immediateFn(function () { var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { - (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + (self._state === 1 ? resolve$1 : reject$1)(deferred.promise, self._value); return; } var ret; try { ret = cb(self._value); } catch (e) { - reject(deferred.promise, e); + reject$1(deferred.promise, e); return; } - resolve(deferred.promise, ret); + resolve$1(deferred.promise, ret); }); } - function resolve(self, newValue) { + function resolve$1(self, newValue) { try { if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { var then = newValue.then; - if (newValue instanceof Promise$1) { + if (newValue instanceof Promise$2) { self._state = 3; self._value = newValue; finale(self); @@ -1747,19 +1970,19 @@ window.adobe.target = (function () { self._value = newValue; finale(self); } catch (e) { - reject(self, e); + reject$1(self, e); } } - function reject(self, newValue) { + function reject$1(self, newValue) { self._state = 2; self._value = newValue; finale(self); } function finale(self) { if (self._state === 2 && self._deferreds.length === 0) { - Promise$1._immediateFn(function () { + Promise$2._immediateFn(function () { if (!self._handled) { - Promise$1._unhandledRejectionFn(self._value); + Promise$2._unhandledRejectionFn(self._value); } }); } @@ -1779,30 +2002,30 @@ window.adobe.target = (function () { fn(function (value) { if (done) return; done = true; - resolve(self, value); + resolve$1(self, value); }, function (reason) { if (done) return; done = true; - reject(self, reason); + reject$1(self, reason); }); } catch (ex) { if (done) return; done = true; - reject(self, ex); + reject$1(self, ex); } } - Promise$1.prototype['catch'] = function (onRejected) { + Promise$2.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; - Promise$1.prototype.then = function (onFulfilled, onRejected) { - var prom = new this.constructor(noop$1); + Promise$2.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); handle(this, new Handler(onFulfilled, onRejected, prom)); return prom; }; - Promise$1.prototype['finally'] = finallyConstructor; - Promise$1.all = function (arr) { - return new Promise$1(function (resolve, reject) { - if (!isArray$1(arr)) { + Promise$2.prototype['finally'] = finallyConstructor; + Promise$2.all = function (arr) { + return new Promise$2(function (resolve, reject) { + if (!isArray(arr)) { return reject(new TypeError('Promise.all accepts an array')); } var args = Array.prototype.slice.call(arr); @@ -1832,36 +2055,36 @@ window.adobe.target = (function () { } }); }; - Promise$1.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise$1) { + Promise$2.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise$2) { return value; } - return new Promise$1(function (resolve) { + return new Promise$2(function (resolve) { resolve(value); }); }; - Promise$1.reject = function (value) { - return new Promise$1(function (resolve, reject) { + Promise$2.reject = function (value) { + return new Promise$2(function (resolve, reject) { reject(value); }); }; - Promise$1.race = function (arr) { - return new Promise$1(function (resolve, reject) { - if (!isArray$1(arr)) { + Promise$2.race = function (arr) { + return new Promise$2(function (resolve, reject) { + if (!isArray(arr)) { return reject(new TypeError('Promise.race accepts an array')); } for (var i = 0, len = arr.length; i < len; i++) { - Promise$1.resolve(arr[i]).then(resolve, reject); + Promise$2.resolve(arr[i]).then(resolve, reject); } }); }; - Promise$1._immediateFn = + Promise$2._immediateFn = typeof setImmediate === 'function' && function (fn) { setImmediate(fn); } || function (fn) { setTimeoutFunc(fn, 0); }; - Promise$1._unhandledRejectionFn = function _unhandledRejectionFn(err) { + Promise$2._unhandledRejectionFn = function _unhandledRejectionFn(err) { if (typeof console !== 'undefined' && console) { console.warn('Possible Unhandled Promise Rejection:', err); } @@ -1869,12 +2092,12 @@ window.adobe.target = (function () { var src = /*#__PURE__*/Object.freeze({ __proto__: null, - 'default': Promise$1 + 'default': Promise$2 }); - var require$$0 = getCjsExportFromNamespace(src); + var require$$0 = /*@__PURE__*/getAugmentedNamespace(src); - var reactorPromise = typeof window !== 'undefined' && window.Promise || typeof commonjsGlobal !== 'undefined' && commonjsGlobal.Promise || require$$0.default || require$$0; + var reactorPromise = typeof window !== 'undefined' && window.Promise || typeof commonjsGlobal$1 !== 'undefined' && commonjsGlobal$1.Promise || require$$0.default || require$$0; var $ = (function (window) { var Zepto = function () { @@ -2969,8 +3192,9 @@ window.adobe.target = (function () { var zepto = $.zepto, oldQsa = zepto.qsa, childRe = /^\s*>/, + shadowDomSeparator = ":shadow", classTag = "Zepto" + +new Date(); - zepto.qsa = function (node, selector) { + var qsa = function (node, selector) { var sel = selector, nodes, taggedParent; @@ -2985,11 +3209,34 @@ window.adobe.target = (function () { } return nodes; }; + zepto.qsa = function (node, selector) { + var parts = selector.split(shadowDomSeparator); + if (parts.length < 2) { + return qsa(node, selector); + } + var parent = node; + for (var i = 0; i < parts.length; i++) { + var part = parts[i].trim(); + var subselIdx = part.indexOf(">"); + if (subselIdx === 0) { + var prefix = ":host "; + if (parent instanceof Element || parent instanceof HTMLDocument) { + prefix = ":scope "; + } + part = prefix + part; + } + var partNode = qsa(parent, part); + if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) { + return partNode; + } + parent = partNode[0].shadowRoot; + } + }; })(Zepto); return Zepto; })(window); - const MO_OBJECT = window.MutationObserver || window.WebkitMutationObserver; + const MO_OBJECT = window$1.MutationObserver || window$1.WebkitMutationObserver; function canUseMutationObserver() { return isFunction(MO_OBJECT); } @@ -2999,7 +3246,7 @@ window.adobe.target = (function () { const ARRAY_EXPECTED = "Expected an array of promises"; function getMoImmediateFn() { - const textnode = document.createTextNode(""); + const textnode = document$1.createTextNode(""); const twiddleNode = () => { textnode.textContent = textnode.textContent.length > 0 ? "" : "a"; }; @@ -3028,7 +3275,7 @@ window.adobe.target = (function () { scriptEl = null; fn(); }); - $(document.documentElement).append(scriptEl); + $(document$1.documentElement).append(scriptEl); }; } function setupPromiseImmediateFn() { @@ -3036,37 +3283,37 @@ window.adobe.target = (function () { reactorPromise._setImmediateFn(getMoImmediateFn()); return; } - if (window.navigator.userAgent.indexOf("MSIE 10") !== -1) { + if (window$1.navigator.userAgent.indexOf("MSIE 10") !== -1) { reactorPromise._setImmediateFn(getOnReadyStateChangeImmediateFn()); } } if (reactorPromise._setImmediateFn) { setupPromiseImmediateFn(); } - function create(func) { + function create$1(func) { return new reactorPromise(func); } - function resolve$1(value) { + function resolve(value) { return reactorPromise.resolve(value); } - function reject$1(value) { + function reject(value) { return reactorPromise.reject(value); } function race(arr) { - if (!isArray(arr)) { - return reject$1(new TypeError(ARRAY_EXPECTED)); + if (!isArray$1(arr)) { + return reject(new TypeError(ARRAY_EXPECTED)); } return reactorPromise.race(arr); } function all(arr) { - if (!isArray(arr)) { - return reject$1(new TypeError(ARRAY_EXPECTED)); + if (!isArray$1(arr)) { + return reject(new TypeError(ARRAY_EXPECTED)); } return reactorPromise.all(arr); } function timeout(promise, time, message) { let id = -1; - const delayedPromise = create((_, rej) => { + const delayedPromise = create$1((_, rej) => { id = delay(() => rej(new Error(message)), time); }); return race([promise, delayedPromise]).then(val => { @@ -3106,12 +3353,12 @@ window.adobe.target = (function () { } function fetchPermissions(win, key) { if (!isOptinAvailable(win)) { - return resolve$1(true); + return resolve(true); } const optIn = win[ADOBE][OPTIN]; const categories = win[ADOBE][OPTIN][CATEGORIES] || {}; const category = categories[key]; - return create((res, rej) => { + return create$1((res, rej) => { optIn[FETCH_PERMISSIONS](() => { if (optIn[IS_APPROVED](category)) { res(true); @@ -3125,23 +3372,23 @@ window.adobe.target = (function () { function shouldUseOptin() { const config = getConfig(); const optinEnabled = config[OPTIN_ENABLED]; - return isOptinEnabled(window, optinEnabled); + return isOptinEnabled(window$1, optinEnabled); } function isTargetApproved() { - return isCategoryApproved(window, TARGET); + return isCategoryApproved(window$1, TARGET); } function isAnalyticsApproved() { - return isCategoryApproved(window, ANALYTICS); + return isCategoryApproved(window$1, ANALYTICS); } function fetchOptinPermissions() { - return fetchPermissions(window, TARGET); + return fetchPermissions(window$1, TARGET); } const SESSION_ID = uuid(); function getSessionIdFromQuery() { const { location - } = window; + } = window$1; const { search } = location; @@ -3274,11 +3521,11 @@ window.adobe.target = (function () { doc.dispatchEvent(event); } - bootstrapNotify(window, document); + bootstrapNotify(window$1, document$1); const LIBRARY_LOADED = "at-library-loaded"; const REQUEST_START = "at-request-start"; - const REQUEST_SUCCEEDED$1 = "at-request-succeeded"; - const REQUEST_FAILED$1 = "at-request-failed"; + const REQUEST_SUCCEEDED = "at-request-succeeded"; + const REQUEST_FAILED = "at-request-failed"; const CONTENT_RENDERING_START = "at-content-rendering-start"; const CONTENT_RENDERING_SUCCEEDED = "at-content-rendering-succeeded"; const CONTENT_RENDERING_FAILED = "at-content-rendering-failed"; @@ -3320,47 +3567,48 @@ window.adobe.target = (function () { } function notifyLibraryLoaded() { const payload = buildPayload(LIBRARY_LOADED, {}); - notify(window, document, LIBRARY_LOADED, payload); + notify(window$1, document$1, LIBRARY_LOADED, payload); } function notifyRequestStart(detail) { const payload = buildPayload(REQUEST_START, detail); - notify(window, document, REQUEST_START, payload); + notify(window$1, document$1, REQUEST_START, payload); } function notifyRequestSucceeded(detail, redirect) { - const payload = buildPayload(REQUEST_SUCCEEDED$1, detail); + const payload = buildPayload(REQUEST_SUCCEEDED, detail); payload.redirect = redirect; - notify(window, document, REQUEST_SUCCEEDED$1, payload); + notify(window$1, document$1, REQUEST_SUCCEEDED, payload); } function notifyRequestFailed(detail) { - const payload = buildPayload(REQUEST_FAILED$1, detail); - notify(window, document, REQUEST_FAILED$1, payload); + const payload = buildPayload(REQUEST_FAILED, detail); + notify(window$1, document$1, REQUEST_FAILED, payload); } function notifyRenderingStart(detail) { const payload = buildPayload(CONTENT_RENDERING_START, detail); - notify(window, document, CONTENT_RENDERING_START, payload); + notify(window$1, document$1, CONTENT_RENDERING_START, payload); } function notifyRenderingSucceeded(detail) { const payload = buildPayload(CONTENT_RENDERING_SUCCEEDED, detail); - notify(window, document, CONTENT_RENDERING_SUCCEEDED, payload); + notify(window$1, document$1, CONTENT_RENDERING_SUCCEEDED, payload); } function notifyRenderingFailed(detail) { const payload = buildPayload(CONTENT_RENDERING_FAILED, detail); - notify(window, document, CONTENT_RENDERING_FAILED, payload); + notify(window$1, document$1, CONTENT_RENDERING_FAILED, payload); } function notifyRenderingNoOffers(detail) { const payload = buildPayload(CONTENT_RENDERING_NO_OFFERS, detail); - notify(window, document, CONTENT_RENDERING_NO_OFFERS, payload); + notify(window$1, document$1, CONTENT_RENDERING_NO_OFFERS, payload); } function notifyRenderingRedirect(detail) { const payload = buildPayload(CONTENT_RENDERING_REDIRECT, detail); - notify(window, document, CONTENT_RENDERING_REDIRECT, payload); + notify(window$1, document$1, CONTENT_RENDERING_REDIRECT, payload); } function notifyOnDeviceDecisioning(eventName, payload) { - notify(window, document, eventName, payload); + notify(window$1, document$1, eventName, payload); } + var Promise$1 = reactorPromise; var getPromise = function (url, script) { - return new reactorPromise(function (resolve, reject) { + return new Promise$1(function (resolve, reject) { script.onload = function () { resolve(script); }; @@ -3386,7 +3634,7 @@ window.adobe.target = (function () { const EQ_END = ")"; const EQ_LENGTH = EQ_START.length; const DIGIT_IN_SELECTOR_PATTERN = /((\.|#)(-)?\d{1})/g; - function createPair(match) { + function createPair$1(match) { const first = match.charAt(0); const second = match.charAt(1); const third = match.charAt(2); @@ -3405,7 +3653,7 @@ window.adobe.target = (function () { if (isEmpty(matches)) { return selector; } - const pairs = map(createPair, matches); + const pairs = map(createPair$1, matches); return reduce((acc, pair) => acc.replace(pair.key, pair.val), selector, pairs); } function parseSelector(selector) { @@ -3459,9 +3707,9 @@ window.adobe.target = (function () { acc = acc.eq(eq); } return acc; - }, $(document), parts); + }, $(document$1), parts); } - function exists$2(selector) { + function exists(selector) { return select(selector).length > 0; } function fragment(content) { @@ -3495,17 +3743,17 @@ window.adobe.target = (function () { const EDITOR = "clickHandlerForExperienceEditor"; const CURRENT_VIEW = "currentView"; function initNamespace() { - window[NAMESPACE] = window[NAMESPACE] || {}; - window[NAMESPACE].querySelectorAll = select; + window$1[NAMESPACE] = window$1[NAMESPACE] || {}; + window$1[NAMESPACE].querySelectorAll = select; } function handleAuthoringTriggeredView(options) { const viewName = options[VIEW_NAME]; - window[NAMESPACE][CURRENT_VIEW] = viewName; + window$1[NAMESPACE][CURRENT_VIEW] = viewName; } function setupClickHandler() { - document.addEventListener(CLICK, event => { - if (isFunction(window[NAMESPACE][EDITOR])) { - window[NAMESPACE][EDITOR](event); + document$1.addEventListener(CLICK, event => { + if (isFunction(window$1[NAMESPACE][EDITOR])) { + window$1[NAMESPACE][EDITOR](event); } }, true); } @@ -3529,7 +3777,7 @@ window.adobe.target = (function () { const TRUE_AUDIENCE_IDS = "at_preview_evaluate_as_true_audience_ids"; const FALSE_AUDIENCE_IDS = "at_preview_evaluate_as_false_audience_ids"; const UNDERSCORE = "_"; - const notNull = v => !isNil(v); + const notNull$1 = v => !isNil(v); let qaModeActive = false; function toNumber(value) { return parseInt(value, 10); @@ -3556,10 +3804,10 @@ window.adobe.target = (function () { return result; } function parsePreviewIndexes(values) { - return filter(notNull, map(parsePreviewIndex, values)); + return filter(notNull$1, map(parsePreviewIndex, values)); } function extractPreviewIndexes(value) { - if (isArray(value)) { + if (isArray$1(value)) { return parsePreviewIndexes(value); } return parsePreviewIndexes([value]); @@ -3670,7 +3918,7 @@ window.adobe.target = (function () { return previewActive; } - function remove(selector) { + function remove$4(selector) { return select(selector).empty().remove(); } function after(content, selector) { @@ -3685,13 +3933,13 @@ window.adobe.target = (function () { function prepend(content, selector) { return select(selector).prepend(content); } - function setHtml(content, selector) { + function setHtml$3(content, selector) { return select(selector).html(content); } function getHtml(selector) { return select(selector).html(); } - function setText(content, selector) { + function setText$4(content, selector) { return select(selector).text(content); } @@ -3716,7 +3964,7 @@ window.adobe.target = (function () { if (bodyHidingEnabled !== true) { return; } - if (exists$2(BODY_STYLE_ID_SELECTOR)) { + if (exists(BODY_STYLE_ID_SELECTOR)) { return; } const bodyHiddenStyle = config[BODY_HIDDEN_STYLE]; @@ -3727,16 +3975,16 @@ window.adobe.target = (function () { if (bodyHidingEnabled !== true) { return; } - if (!exists$2(BODY_STYLE_ID_SELECTOR)) { + if (!exists(BODY_STYLE_ID_SELECTOR)) { return; } - remove(BODY_STYLE_ID_SELECTOR); + remove$4(BODY_STYLE_ID_SELECTOR); } function addActionHidings(config, selectors) { if (isEmpty(selectors)) { return; } - const alreadyHidden = selector => !exists$2("#" + (STYLE_PREFIX + hash(selector))); + const alreadyHidden = selector => !exists("#" + (STYLE_PREFIX + hash(selector))); const selectorsToHide = filter(alreadyHidden, selectors); if (isEmpty(selectorsToHide)) { return; @@ -3747,7 +3995,7 @@ window.adobe.target = (function () { append(content, HEAD_TAG); } function addAllViewsHidings(config, selectors) { - if (isEmpty(selectors) || exists$2("#" + ALL_VIEWS_STYLE_ID)) { + if (isEmpty(selectors) || exists("#" + ALL_VIEWS_STYLE_ID)) { return; } const styleDef = config[DEFAULT_CONTENT_HIDDEN_STYLE]; @@ -3770,12 +4018,12 @@ window.adobe.target = (function () { } function removeActionHidingStyle(selector) { const id = STYLE_PREFIX + hash(selector); - remove("#" + id); + remove$4("#" + id); } function removeAllViewsHidingStyle() { const hidingStyleSelector = "#" + ALL_VIEWS_STYLE_ID; - if (exists$2(hidingStyleSelector)) { - remove(hidingStyleSelector); + if (exists(hidingStyleSelector)) { + remove$4(hidingStyleSelector); } } @@ -3905,26 +4153,26 @@ window.adobe.target = (function () { const ERROR_MESSAGE = "Visitor API requests error"; function getVisitorValuesAsync(visitor, optoutEnabled) { if (!isFunction(visitor.getVisitorValues)) { - return resolve$1({}); + return resolve({}); } const fields = [MCMID, MCAAMB, MCAAMLH]; if (optoutEnabled) { fields.push(MCOPTOUT); } - return create(res => { + return create$1(res => { visitor.getVisitorValues(values => res(values), fields); }); } - function handleError(error) { + function handleError$1(error) { logDebug(ERROR_MESSAGE, error); return {}; } function getAsyncValues(visitor, visitorApiTimeout, optoutEnabled) { if (isNil(visitor)) { - return resolve$1({}); + return resolve({}); } const requests = getVisitorValuesAsync(visitor, optoutEnabled); - return timeout(requests, visitorApiTimeout, TIMEOUT_MESSAGE)['catch'](handleError); + return timeout(requests, visitorApiTimeout, TIMEOUT_MESSAGE)['catch'](handleError$1); } function getVisitorValues(visitor, optoutEnabled) { @@ -3950,7 +4198,7 @@ window.adobe.target = (function () { const config = getConfig(); const imsOrgId = config[IMS_ORG_ID]; const sdidParamExpiry = config[SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT]; - return getInstance(window, imsOrgId, sdidParamExpiry); + return getInstance(window$1, imsOrgId, sdidParamExpiry); } function getAsyncVisitorValues() { const visitor = getVisitorInstance(); @@ -3983,7 +4231,7 @@ window.adobe.target = (function () { return storage[key]; } - const LOG_PREFIX = "Data provider"; + const LOG_PREFIX$1 = "Data provider"; const TIMED_OUT = "timed out"; const MAX_TIMEOUT = 2000; function areDataProvidersPresent(win) { @@ -3992,7 +4240,7 @@ window.adobe.target = (function () { return false; } const dataProviders = globalSettings[DATA_PROVIDERS]; - if (!isArray(dataProviders) || isEmpty(dataProviders)) { + if (!isArray$1(dataProviders) || isEmpty(dataProviders)) { return false; } return true; @@ -4006,7 +4254,7 @@ window.adobe.target = (function () { if (!isString(version) || isEmpty(version)) { return false; } - const wait = dataProvider[TIMEOUT]; + const wait = dataProvider[TIMEOUT$1]; if (!isNil(wait) && !isNumber(wait)) { return false; } @@ -4017,7 +4265,7 @@ window.adobe.target = (function () { return true; } function createPromise(provider) { - return create((success, error) => { + return create$1((success, error) => { provider((err, params) => { if (!isNil(err)) { error(err); @@ -4027,7 +4275,7 @@ window.adobe.target = (function () { }); }); } - function createTrace(nameKey, name, versionKey, version, resKey, res) { + function createTrace$2(nameKey, name, versionKey, version, resKey, res) { const dataProviderTrace = {}; dataProviderTrace[nameKey] = name; dataProviderTrace[versionKey] = version; @@ -4039,17 +4287,17 @@ window.adobe.target = (function () { function convertToPromise(dataProvider) { const name = dataProvider[NAME]; const version = dataProvider[VERSION]; - const wait = dataProvider[TIMEOUT] || MAX_TIMEOUT; + const wait = dataProvider[TIMEOUT$1] || MAX_TIMEOUT; const provider = dataProvider[PROVIDER]; const promise = createPromise(provider); return timeout(promise, wait, TIMED_OUT).then(params => { - const trace = createTrace(NAME, name, VERSION, version, PARAMS, params); - logDebug(LOG_PREFIX, SUCCESS, trace); + const trace = createTrace$2(NAME, name, VERSION, version, PARAMS, params); + logDebug(LOG_PREFIX$1, SUCCESS, trace); addClientTrace(trace); return params; })['catch'](error => { - const trace = createTrace(NAME, name, VERSION, version, ERROR, error); - logDebug(LOG_PREFIX, ERROR, trace); + const trace = createTrace$2(NAME, name, VERSION, version, ERROR, error); + logDebug(LOG_PREFIX$1, ERROR, trace); addClientTrace(trace); return {}; }); @@ -4061,7 +4309,7 @@ window.adobe.target = (function () { } function executeAsyncDataProviders(win) { if (!areDataProvidersPresent(win)) { - return resolve$1({}); + return resolve({}); } const dataProviders = win[GLOBAL_SETTINGS][DATA_PROVIDERS]; const validProviders = filter(isValidDataProvider, dataProviders); @@ -4076,7 +4324,7 @@ window.adobe.target = (function () { } function getAsyncDataProvidersParameters() { - return executeAsyncDataProviders(window); + return executeAsyncDataProviders(window$1); } function getSyncDataProvidersParameters() { return executeSyncDataProviders(); @@ -4106,7 +4354,7 @@ window.adobe.target = (function () { return result; } function getTraceToken() { - const param = getTokenFromQueryString(window); + const param = getTokenFromQueryString(window$1); const cookie = getTokenFromCookie(); return param || cookie; } @@ -4114,7 +4362,7 @@ window.adobe.target = (function () { function isPair(pair) { return !isEmpty(pair) && pair.length === 2 && isNotBlank(pair[0]); } - function createPair$1(param) { + function createPair(param) { const index = param.indexOf("="); if (index === -1) { return []; @@ -4139,11 +4387,11 @@ window.adobe.target = (function () { } function arrayToParams(array) { const pairs = reduce((acc, param) => { - acc.push(createPair$1(param)); + acc.push(createPair(param)); return acc; }, [], filter(isNotBlank, array)); return reduce((acc, pair) => { - acc[decode$1(trim(pair[0]))] = decode$1(trim(pair[1])); + acc[decode(trim(pair[0]))] = decode(trim(pair[1])); return acc; }, {}, filter(isPair, pairs)); } @@ -4169,7 +4417,7 @@ window.adobe.target = (function () { if (isNil(params)) { return {}; } - if (isArray(params)) { + if (isArray$1(params)) { return arrayToParams(params); } if (isString(params) && isNotBlank(params)) { @@ -4182,10 +4430,10 @@ window.adobe.target = (function () { } function getParamsAll(mboxParams) { - return reactorObjectAssign({}, mboxParams, functionToParams(window.targetPageParamsAll)); + return reactorObjectAssign({}, mboxParams, functionToParams(window$1.targetPageParamsAll)); } - function getParams(globalMboxParams) { - return reactorObjectAssign({}, globalMboxParams, functionToParams(window.targetPageParams)); + function getParams$1(globalMboxParams) { + return reactorObjectAssign({}, globalMboxParams, functionToParams(window$1.targetPageParams)); } function getTargetPageParams(mbox) { const config = getConfig(); @@ -4195,11 +4443,11 @@ window.adobe.target = (function () { if (globalMbox !== mbox) { return getParamsAll(mboxParams || {}); } - return reactorObjectAssign(getParamsAll(mboxParams || {}), getParams(globalMboxParams || {})); + return reactorObjectAssign(getParamsAll(mboxParams || {}), getParams$1(globalMboxParams || {})); } function getWebGLRendererInternal() { - const canvas = document.createElement("canvas"); + const canvas = document$1.createElement("canvas"); const gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl"); if (isNil(gl)) { return null; @@ -4218,14 +4466,14 @@ window.adobe.target = (function () { function getPixelRatio() { let { devicePixelRatio: ratio - } = window; + } = window$1; if (!isNil(ratio)) { return ratio; } ratio = 1; const { screen - } = window; + } = window$1; const { systemXDPI, logicalXDPI @@ -4238,7 +4486,7 @@ window.adobe.target = (function () { function getScreenOrientation() { const { screen - } = window; + } = window$1; const { orientation, width, @@ -4305,7 +4553,7 @@ window.adobe.target = (function () { function getThirdPartyId(parameters) { return parameters[THIRD_PARTY_ID]; } - function getPropertyToken$1(params) { + function getPropertyToken(params) { return params[PROPERTY_TOKEN]; } function getOrderId(params) { @@ -4325,7 +4573,8 @@ window.adobe.target = (function () { function getCategoryId(params) { return params[CATEGORY_ID]; } - function getParams$1(params) { + function getParams() { + let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return reduce((acc, value, key) => { if (isSpecialParam(key)) { return acc; @@ -4334,12 +4583,14 @@ window.adobe.target = (function () { return acc; }, {}, params); } - function getProfileParams(params) { + function getProfileParams() { + let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + let prefixedKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; return reduce((acc, value, key) => { - if (!isProfileParam(key)) { + const profileKey = prefixedKeys ? extractProfileParam(key) : key; + if (prefixedKeys && !isProfileParam(key)) { return acc; } - const profileKey = extractProfileParam(key); if (isBlank(profileKey)) { return acc; } @@ -4348,6332 +4599,6378 @@ window.adobe.target = (function () { }, {}, params); } - const POST = "POST"; - const NETWORK_ERROR = "Network request failed"; - const REQUEST_TIMEOUT = "Request timed out"; - const MALFORMED_RESPONSE = "Malformed response JSON"; - function addOnload(xhr, resolve, reject) { - xhr.onload = () => { - const status = xhr.status === 1223 ? 204 : xhr.status; - if (status < 100 || status > 599) { - reject(new Error(NETWORK_ERROR)); - return; - } - let response; - try { - response = JSON.parse(xhr.responseText); - } catch (e) { - reject(new Error(MALFORMED_RESPONSE)); - return; - } - const headers = xhr.getAllResponseHeaders(); - resolve({ - status, - headers, - response - }); - }; - return xhr; - } - function addOnerror(xhr, reject) { - xhr.onerror = () => { - reject(new Error(NETWORK_ERROR)); - }; - return xhr; - } - function addOntimeout(xhr, timeout, reject) { - xhr.timeout = timeout; - xhr.ontimeout = () => { - reject(new Error(REQUEST_TIMEOUT)); - }; - return xhr; - } - function addHeaders(xhr, headers = {}) { - forEach((values, key) => { - if (!isArray(values)) { - return; - } - forEach(value => { - xhr.setRequestHeader(key, value); - }, values); - }, headers); - return xhr; - } - function executeXhr({ - url, - headers, - body, - timeout, - async - }) { - return create((resolve, reject) => { - let xhr = new window.XMLHttpRequest(); - xhr = addOnload(xhr, resolve, reject); - xhr = addOnerror(xhr, reject); - xhr.open(POST, url, async); - xhr.withCredentials = true; - xhr = addHeaders(xhr, headers); - if (async) { - xhr = addOntimeout(xhr, timeout, reject); - } - xhr.send(JSON.stringify(body)); - }).then(xhrResponse => { - const { - response - } = xhrResponse; - const { - status, - message - } = response; - if (!isNil(status) && !isNil(message)) { - throw new Error(message); - } - return response; - }); - } + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); - const EDGE_SERVER_PREFIX = "mboxedge"; - const EDGE_SERVER_DOMAIN = ".tt.omtrdc.net"; - const notEmpty = val => !isEmpty(val); - function throwIfOptout(values) { - const optout = values[MCOPTOUT]; - if (optout) { - throw new Error(OPTOUT_MESSAGE); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); } - return values; - } - function getAsyncThirdPartyData() { - const visitorValues = getAsyncVisitorValues(); - const dataProvidersParams = getAsyncDataProvidersParameters(); - return all([visitorValues.then(throwIfOptout), dataProvidersParams]); - } - function getSyncThirdPartyData() { - const visitorValues = getSyncVisitorValues(); - const dataProvidersParams = getSyncDataProvidersParameters(); - return [visitorValues, dataProvidersParams]; + + return keys; } - function getAllParams(providersParams) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - return reactorObjectAssign({}, providersParams, getTargetPageParams(globalMbox)); + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + + return target; } - function getTimeOffset() { - return -new Date().getTimezoneOffset(); + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; } - function createScreen() { - const { - screen - } = window; - return { - width: screen.width, - height: screen.height, - orientation: getScreenOrientation(), - colorDepth: screen.colorDepth, - pixelRatio: getPixelRatio() - }; + + const Messages = { + ERROR_MAX_RETRY: (numRetries, errString) => "Unable to retrieve artifact after " + numRetries + " retries: " + errString, + ARTIFACT_NOT_AVAILABLE: "The decisioning artifact is not available", + ARTIFACT_VERSION_UNSUPPORTED: (artifactVersion, supportedMajorVersion) => "The decisioning artifact version (" + artifactVersion + ") is not supported. This library is compatible with this major version: " + supportedMajorVersion, + ARTIFACT_FETCH_ERROR: reason => "Failed to retrieve artifact: " + reason, + ARTIFACT_INVALID: "Invalid Artifact", + INVALID_ENVIRONMENT: (expectedEnvironment, defaultEnvironment) => "'" + expectedEnvironment + "' is not a valid target environment, defaulting to '" + defaultEnvironment + "'.", + NOT_APPLICABLE: "Not Applicable", + ARTIFACT_OBFUSCATION_ERROR: "Unable to read artifact JSON", + UNKNOWN: "unknown" + }; + + const DEFAULT_POLLING_INTERVAL$1 = 300000; + const MINIMUM_POLLING_INTERVAL = 300000; + const NUM_FETCH_RETRIES = 10; + const SUPPORTED_ARTIFACT_MAJOR_VERSION = 1; + const SUPPORTED_ARTIFACT_OBFUSCATION_VERSION = 1; + const REGEX_ARTIFACT_FILENAME_BINARY = /.+\.bin$/i; + const ARTIFACT_FORMAT_BINARY = "bin"; + const ARTIFACT_FORMAT_JSON = "json"; + const ARTIFACT_FORMAT_DEFAULT = ARTIFACT_FORMAT_JSON; + const ARTIFACT_FORMATS = [ARTIFACT_FORMAT_BINARY, ARTIFACT_FORMAT_JSON]; + const ARTIFACT_FILENAME = {}; + ARTIFACT_FILENAME[ARTIFACT_FORMAT_BINARY] = "rules.bin"; + ARTIFACT_FILENAME[ARTIFACT_FORMAT_JSON] = "rules.json"; + const LOG_PREFIX = "LD"; + const CDN_BASE_PROD = "assets.adobetarget.com"; + const CDN_BASE_STAGE = "assets.staging.adobetarget.com"; + const CDN_BASE_DEV = "assets.staging.adobetarget.com"; + const HTTP_HEADER_FORWARDED_FOR = "x-forwarded-for"; + const HTTP_HEADER_GEO_LATITUDE = "x-geo-latitude"; + const HTTP_HEADER_GEO_LONGITUDE = "x-geo-longitude"; + const HTTP_HEADER_GEO_COUNTRY = "x-geo-country-code"; + const HTTP_HEADER_GEO_REGION = "x-geo-region-code"; + const HTTP_HEADER_GEO_CITY = "x-geo-city"; + const CDN_BASE = {}; + CDN_BASE[ENVIRONMENT_PROD] = CDN_BASE_PROD; + CDN_BASE[ENVIRONMENT_STAGE] = CDN_BASE_STAGE; + CDN_BASE[ENVIRONMENT_DEV] = CDN_BASE_DEV; + const CAMPAIGN_BUCKET_SALT = "0"; + const AUDIENCE_IDS = "audience.ids"; + const ACTIVITY_DECISIONING_METHOD = "activity.decisioningMethod"; + const ACTIVITY_ID = "activity.id"; + const ACTIVITY_NAME = "activity.name"; + const ACTIVITY_TYPE = "activity.type"; + const EXPERIENCE_ID = "experience.id"; + const EXPERIENCE_NAME = "experience.name"; + const LOCATION_ID = "location.id"; + const LOCATION_NAME = "location.name"; + const LOCATION_TYPE = "location.type"; + const OFFER_ID = "offer.id"; + const OFFER_NAME = "offer.name"; + const OPTION_ID = "option.id"; + const OPTION_NAME = "option.name"; + const GEO_CITY = "geo.city"; + const GEO_COUNTRY = "geo.country"; + const GEO_STATE = "geo.state"; + const GEO_LATITUDE = "geo.latitude"; + const GEO_LONGITUDE = "geo.longitude"; + + function getRuleKey(rule) { + return rule.ruleKey; } - function createWindow() { + function parseURL(url) { + if (!isString(url)) { + url = ""; + } + const parsed = parseUri$1(url) || {}; const { - documentElement - } = document; - return { - width: documentElement.clientWidth, - height: documentElement.clientHeight + host = "", + path = "", + query = "", + anchor = "" + } = parsed; + const result = { + url, + path, + query, + fragment: anchor }; + const domainParts = host.split("."); + switch (domainParts.length) { + case 1: + result.subdomain = ""; + result.domain = host; + result.topLevelDomain = ""; + break; + case 2: + result.subdomain = ""; + result.domain = host; + result.topLevelDomain = domainParts[1]; + break; + case 3: + result.subdomain = domainParts[0] === "www" ? "" : domainParts[0]; + result.domain = host; + result.topLevelDomain = domainParts[2]; + break; + case 4: + result.subdomain = domainParts[0] === "www" ? "" : domainParts[0]; + result.domain = host; + result.topLevelDomain = domainParts[2] + "." + domainParts[3]; + break; + } + return result; } - function createBrowser() { + function hasRemoteDependency$1(artifact, request) { + if (isUndefined(artifact)) { + throw new Error(Messages.ARTIFACT_NOT_AVAILABLE); + } + const requestedMboxes = Array.from(getMboxNames(request)); + if (request.execute && isPojo(request.execute.pageLoad) || request.prefetch && isPojo(request.prefetch.pageLoad)) { + requestedMboxes.push(DEFAULT_GLOBAL_MBOX); + } + const requestedViews = Array.from(getViewNames(request)); const { - location - } = window; + remoteMboxes = [], + localMboxes = [], + remoteViews = [], + localViews = [] + } = artifact; + const mboxesThatRequireRemote = new Set([...remoteMboxes.filter(mboxName => includes(mboxName, requestedMboxes)), ...requestedMboxes.filter(mboxName => !includes(mboxName, localMboxes))]); + const viewsThatRequireRemote = hasRequestedViews(request) && requestedViews.length === 0 ? new Set(remoteViews) : new Set([...remoteViews.filter(viewName => includes(viewName, requestedViews)), ...requestedViews.filter(viewName => !includes(viewName, localViews))]); return { - host: location.hostname, - webGLRenderer: getWebGLRenderer() + remoteNeeded: mboxesThatRequireRemote.size > 0 || viewsThatRequireRemote.size > 0, + remoteMboxes: Array.from(mboxesThatRequireRemote), + remoteViews: Array.from(viewsThatRequireRemote) }; } - function createAddress() { - const { - location - } = window; - return { - url: location.href, - referringUrl: document.referrer - }; + function matchMajorVersion(semanticVersion, majorVersion) { + const [major, minor, patch] = semanticVersion.split(".").map(value => parseInt(value, 10)); + return majorVersion === major; } - function createContext(context) { - if (!isNil(context) && context.channel === WEB_CHANNEL) { - return context; + function cloneDeep(obj) { + if (isDefined(obj)) { + return JSON.parse(JSON.stringify(obj)); } - const validContext = context || {}; - const { - beacon - } = validContext; - return { - userAgent: window.navigator.userAgent, - timeOffsetInMinutes: getTimeOffset(), - channel: WEB_CHANNEL, - screen: createScreen(), - window: createWindow(), - browser: createBrowser(), - address: createAddress(), - geo: context && context.geo, - beacon - }; + return undefined; } - function createAudienceManager(audienceManager, visitorValues) { - if (!isNil(audienceManager)) { - return audienceManager; - } - const result = {}; - if (isEmpty(visitorValues)) { - return result; - } - const locationHint = visitorValues[MCAAMLH]; - const locationHintNumber = parseInt(locationHint, 10); - if (!isNaN(locationHintNumber)) { - result.locationHint = locationHintNumber; - } - const blob = visitorValues[MCAAMB]; - if (isNotBlank(blob)) { - result.blob = blob; + function getValidEnvironment(environmentName, logger) { + const isValid = includes(environmentName, POSSIBLE_ENVIRONMENTS); + if (!isValid) { + getLogger(logger).debug(Messages.INVALID_ENVIRONMENT(environmentName, ENVIRONMENT_PROD)); } - return result; + return isValid ? environmentName : ENVIRONMENT_PROD; } - function createCustomerId(data) { + function getTargetEnvironment$1(config) { const { - id, - integrationCode, - authenticatedState, - type, - primary - } = data; - const result = {}; - if (isNotBlank(id)) { - result.id = id; - } - if (isNotBlank(integrationCode)) { - result.integrationCode = integrationCode; - } - if (isNotBlank(authenticatedState)) { - result.authenticatedState = authenticatedState; - } - if (isNotBlank(type)) { - result.type = type; - } - if (primary) { - result.primary = primary; - } - return result; + environment = ENVIRONMENT_PROD + } = config; + return getValidEnvironment(environment, config.logger); } - function createCustomerIds(customerIdsValues) { - return map(createCustomerId, customerIdsValues); + function getCdnEnvironment$1(config) { + const { + cdnEnvironment = ENVIRONMENT_PROD + } = config; + return getValidEnvironment(cdnEnvironment, config.logger); } - function createVisitorId(id, deviceId, thirdPartyId, visitorValues, customerIdsValues) { - const result = {}; - if (isNotBlank(deviceId)) { - result.tntId = deviceId; - } - if (isNotBlank(thirdPartyId)) { - result.thirdPartyId = thirdPartyId; - } - if (isNotBlank(id.thirdPartyId)) { - result.thirdPartyId = id.thirdPartyId; - } - const mid = visitorValues[MCMID]; - if (isNotBlank(mid)) { - result.marketingCloudVisitorId = mid; - } - if (isNotBlank(id.marketingCloudVisitorId)) { - result.marketingCloudVisitorId = id.marketingCloudVisitorId; - } - if (!isEmpty(id.customerIds)) { - result.customerIds = id.customerIds; - return result; - } - if (!isEmpty(customerIdsValues)) { - result.customerIds = createCustomerIds(customerIdsValues); + function getCdnBasePath$1(config) { + let { + cdnBasePath + } = config; + if (!isDefined(cdnBasePath)) { + const cdnEnvironment = getCdnEnvironment$1(config); + const env = includes(cdnEnvironment, POSSIBLE_ENVIRONMENTS) ? cdnEnvironment : ENVIRONMENT_PROD; + cdnBasePath = CDN_BASE[env]; } - return result; + return "https://" + cdnBasePath; } - function createExperienceCloud(experienceCloud, visitorValues) { - const result = {}; - const audienceManager = createAudienceManager(experienceCloud.audienceManager, visitorValues); - if (!isEmpty(audienceManager)) { - result.audienceManager = audienceManager; - } - if (!isEmpty(experienceCloud.analytics)) { - result.analytics = experienceCloud.analytics; - } - return result; + function getArtifactFileName() { + let artifactFormat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ARTIFACT_FORMAT_DEFAULT; + artifactFormat = includes(artifactFormat, ARTIFACT_FORMATS) ? artifactFormat : ARTIFACT_FORMAT_DEFAULT; + return ARTIFACT_FILENAME[artifactFormat]; } - function createProperty(property, allParams) { - if (!isNil(property) && isNotBlank(property.token)) { - return property; - } - const result = {}; - const token = getPropertyToken$1(allParams); - if (isNotBlank(token)) { - result.token = token; - } - return result; + function getGeoLookupPath(config) { + const cdnBasePath = getCdnBasePath$1(config); + return cdnBasePath + "/v" + SUPPORTED_ARTIFACT_MAJOR_VERSION + "/geo"; } - function createTrace$1(trace) { - if (!isNil(trace) && isNotBlank(trace.authorizationToken)) { - return trace; - } - const result = {}; - const authorizationToken = getTraceToken(); - if (isNotBlank(authorizationToken)) { - result.authorizationToken = authorizationToken; + function determineArtifactLocation(config) { + const { + client, + propertyToken, + artifactFormat, + artifactLocation + } = config; + if (isString(artifactLocation)) { + return artifactLocation; } - return result; + const targetEnvironment = getTargetEnvironment$1(config); + return [getCdnBasePath$1(config), client, targetEnvironment, "v" + SUPPORTED_ARTIFACT_MAJOR_VERSION, isDefined(propertyToken) ? propertyToken : undefined, getArtifactFileName(artifactFormat)].filter(value => isDefined(value)).join("/"); } - function createPreview(preview) { - if (!isNil(preview)) { - return preview; - } - return getPreview(); + function determineArtifactFormat(artifactLocation) { + return artifactLocation.match(REGEX_ARTIFACT_FILENAME_BINARY) != null ? ARTIFACT_FORMAT_BINARY : ARTIFACT_FORMAT_JSON; } - function createQaMode(qaMode) { - if (!isNil(qaMode)) { - return qaMode; + function firstMatch(key) { + let searchObjects = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + for (let i = 0; i < searchObjects.length; i += 1) { + const haystack = searchObjects[i]; + if (isObject(haystack) && isDefined(haystack[key])) { + return haystack[key]; + } } - return getQaMode(); + return defaultValue; } - function createOrder(params) { + + const EMPTY_CONTEXT = { + channel: ChannelType.Web + }; + function getLowerCaseAttributes(obj) { const result = {}; - const orderId = getOrderId(params); - if (!isNil(orderId)) { - result.id = orderId; - } - const orderTotal = getOrderTotal(params); - const orderTotalNumber = parseFloat(orderTotal); - if (!isNaN(orderTotalNumber)) { - result.total = orderTotalNumber; - } - const purchasedProductIds = getPurchasedProductIds(params); - if (!isEmpty(purchasedProductIds)) { - result.purchasedProductIds = purchasedProductIds; - } + Object.keys(obj).forEach(key => { + result[key + "_lc"] = isString(obj[key]) ? obj[key].toLowerCase() : obj[key]; + }); return result; } - function createProduct(params) { - const result = {}; - const productId = getProductId(params); - if (!isNil(productId)) { - result.id = productId; - } - const categoryId = getCategoryId(params); - if (!isNil(categoryId)) { - result.categoryId = categoryId; - } - return result; + function createBrowserContext(context) { + const { + userAgent = "" + } = context; + const browser = browserFromUserAgent(userAgent); + const platform = operatingSystemFromUserAgent(userAgent); + return { + browserType: browser.name.toLowerCase(), + platform, + locale: "en", + browserVersion: browser.version + }; } - function createRequestDetails(item, allParams) { - const result = {}; - const params = reactorObjectAssign({}, getParams$1(allParams), item.parameters || {}); - const profileParams = reactorObjectAssign({}, getProfileParams(allParams), item.profileParameters || {}); - const order = reactorObjectAssign({}, createOrder(allParams), item.order || {}); - const product = reactorObjectAssign({}, createProduct(allParams), item.product || {}); - if (!isEmpty(params)) { - result.parameters = params; - } - if (!isEmpty(profileParams)) { - result.profileParameters = profileParams; - } - if (!isEmpty(order)) { - result.order = order; - } - if (!isEmpty(product)) { - result.product = product; + function createUrlContext(url) { + if (!url || !isString(url)) { + url = ""; } - return result; + const urlAttributes = parseURL(url); + return _objectSpread2(_objectSpread2({}, urlAttributes), getLowerCaseAttributes(urlAttributes)); } - function createMboxRequestDetails(item, allParams, providersParams = {}) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const { - index, - name, - address - } = item; - const params = reactorObjectAssign({}, name === globalMbox ? allParams : providersParams, getTargetPageParams(name)); - const result = createRequestDetails(item, params); - if (!isNil(index)) { - result.index = index; - } - if (isNotBlank(name)) { - result.name = name; - } - if (!isEmpty(address)) { - result.address = address; + function createPageContext(address) { + return createUrlContext(address ? address.url : ""); + } + function createReferringContext(address) { + return createUrlContext(address ? address.referringUrl : ""); + } + function createMboxContext(mboxRequest) { + if (!mboxRequest) { + return {}; } - return result; + const parameters = mboxRequest.parameters || {}; + return _objectSpread2(_objectSpread2({}, parameters), getLowerCaseAttributes(parameters)); } - function createViewRequestDetails(item, allParams) { - const { - name, - address - } = item; - const result = createRequestDetails(item, allParams); - if (isNotBlank(name)) { - result.name = name; - } - if (!isEmpty(address)) { - result.address = address; - } - return result; + function createGeoContext() { + let geoContext = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return { + country: geoContext.countryCode, + region: geoContext.stateCode, + city: geoContext.city, + latitude: geoContext.latitude, + longitude: geoContext.longitude + }; } - function createExecute(request, allParams, providersParams) { - const { - execute = {} - } = request; - const result = {}; - if (isEmpty(execute)) { - return result; - } + function createTimingContext() { + const now = new Date(); + const twoDigitString = value => value < 10 ? "0" + value : String(value); + const currentHours = twoDigitString(now.getUTCHours()); + const currentMinutes = twoDigitString(now.getUTCMinutes()); + const currentTime = "" + currentHours + currentMinutes; + const currentDay = now.getUTCDay(); + return { + current_timestamp: now.getTime(), + current_time: currentTime, + current_day: currentDay === 0 ? 7 : currentDay + }; + } + function createDecisioningContext(deliveryRequest) { const { - pageLoad - } = execute; - if (!isNil(pageLoad)) { - result.pageLoad = createRequestDetails(pageLoad, allParams); + context = EMPTY_CONTEXT + } = deliveryRequest; + return _objectSpread2(_objectSpread2({}, createTimingContext()), {}, { + user: createBrowserContext(context), + page: createPageContext(context.address), + referring: createReferringContext(context.address), + geo: createGeoContext(context.geo || {}) + }); + } + + const LOG_TAG$2 = LOG_PREFIX + ".NotificationProvider"; + function NotificationProvider(request, visitor, logger) { + let sendNotificationFunc = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop$1; + let telemetryEnabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + const timestamp = now(); + const prevEventKeys = new Set(); + let notifications = []; + function addNotification(mbox) { + let traceFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop$1; + const displayTokens = []; + mbox.options.forEach(option => { + const { + eventToken + } = option; + const eventKey = mbox.name + "-" + eventToken; + if (isDefined(eventToken) && !prevEventKeys.has(eventKey)) { + displayTokens.push(eventToken); + prevEventKeys.add(eventKey); + } + }); + if (displayTokens.length === 0) { + return; + } + const notification = { + id: uuid(), + impressionId: uuid(), + timestamp, + type: MetricType.Display, + mbox: { + name: mbox.name + }, + tokens: displayTokens + }; + if (isFunction(traceFn)) { + traceFn(notification); + } + notifications.push(notification); } - const { - mboxes - } = execute; - if (!isNil(mboxes) && isArray(mboxes) && !isEmpty(mboxes)) { - const temp = filter(notEmpty, map(e => createMboxRequestDetails(e, allParams, providersParams), mboxes)); - if (!isEmpty(temp)) { - result.mboxes = temp; + function sendNotifications() { + logger.debug(LOG_TAG$2 + ".sendNotifications", notifications); + if (notifications.length > 0 || telemetryEnabled) { + const { + id, + context, + experienceCloud + } = request; + const notification = { + request: { + id, + context, + experienceCloud + }, + visitor + }; + if (notifications.length > 0) { + notification.request.notifications = notifications; + } + setTimeout(() => { + try { + sendNotificationFunc.call(null, notification); + } catch (error) { + if (error.message !== NOTIFICATIONS_REQUIRED$1) { + throw error; + } + } + }, 0); + notifications = []; } } - return result; + return { + addNotification, + sendNotifications + }; } - function createPrefetch(request, allParams, providersParams) { - const { - prefetch = {} - } = request; - const result = {}; - if (isEmpty(prefetch)) { - return result; - } - const { - mboxes - } = prefetch; - if (!isNil(mboxes) && isArray(mboxes) && !isEmpty(mboxes)) { - result.mboxes = map(e => createMboxRequestDetails(e, allParams, providersParams), mboxes); - } + + const byOrder = (a, b) => a.order - b.order; + function TraceProvider(config, targetOptions, artifactTrace) { + const clientCode = config.client; const { - views - } = prefetch; - if (!isNil(views) && isArray(views) && !isEmpty(views)) { - result.views = map(e => createViewRequestDetails(e, allParams), views); + sessionId, + request + } = targetOptions; + const showTraces = isDefined(request.trace); + const [tntId, profileLocation] = isDefined(request.id) && isString(request.id.tntId) ? request.id.tntId.split(".") : [undefined, undefined]; + const profile = { + visitorId: _objectSpread2(_objectSpread2({}, request.id), {}, { + tntId, + profileLocation + }) + }; + function wrap(traceResult) { + if (!showTraces) { + return undefined; + } + return { + clientCode, + artifact: artifactTrace, + profile, + request: _objectSpread2({ + sessionId + }, traceResult.request), + campaigns: traceResult.campaigns, + evaluatedCampaignTargets: traceResult.evaluatedCampaignTargets + }; } - return result; + return { + wrap + }; } - function createAnalytics(consumerId, request) { - if (shouldUseOptin() && !isAnalyticsApproved()) { - return null; - } - const config = getConfig(); - const sdid = getSdidVisitorValue(consumerId); - const server = getVisitorProperty(TRACK_SERVER_PROP); - const serverSecure = getVisitorProperty(TRACK_SERVER_SECURE_PROP); - const { - experienceCloud = {} - } = request; - const { - analytics = {} - } = experienceCloud; - const { - logging, - supplementalDataId, - trackingServer, - trackingServerSecure - } = analytics; - const result = {}; - if (!isNil(logging)) { - result.logging = logging; - } else { - result.logging = config[ANALYTICS_LOGGING]; - } - if (!isNil(supplementalDataId)) { - result.supplementalDataId = supplementalDataId; + function RequestTracer(traceProvider, artifact) { + let request = {}; + const campaigns = {}; + let campaignOrder = 0; + const evaluatedCampaignTargets = {}; + let evaluatedCampaignTargetOrder = 0; + function traceRequest(mode, requestType, mboxRequest, context) { + request = { + pageURL: context.page.url, + host: context.page.domain + }; + request[requestType] = _objectSpread2(_objectSpread2({}, mboxRequest), {}, { + type: mode + }); } - if (isNotBlank(sdid)) { - result.supplementalDataId = sdid; + function addCampaign(rule, ruleSatisfied) { + const { + meta + } = rule; + const activityId = meta[ACTIVITY_ID]; + if (ruleSatisfied && isUndefined(campaigns[activityId])) { + campaignOrder += 1; + campaigns[activityId] = { + id: activityId, + order: campaignOrder, + campaignType: meta[ACTIVITY_TYPE], + branchId: meta[EXPERIENCE_ID], + offers: isDefined(meta[OFFER_ID]) ? [meta[OFFER_ID]] : [], + environment: artifact.meta.environment + }; + } } - if (!isNil(trackingServer)) { - result.trackingServer = trackingServer; + function addEvaluatedCampaignTarget(rule, ruleContext, ruleSatisfied) { + const { + meta + } = rule; + const audienceIds = meta[AUDIENCE_IDS]; + const activityId = meta[ACTIVITY_ID]; + if (isUndefined(evaluatedCampaignTargets[activityId])) { + evaluatedCampaignTargetOrder += 1; + evaluatedCampaignTargets[activityId] = { + order: evaluatedCampaignTargetOrder, + context: ruleContext, + campaignId: activityId, + campaignType: meta[ACTIVITY_TYPE], + matchedSegmentIds: new Set(), + unmatchedSegmentIds: new Set(), + matchedRuleConditions: [], + unmatchedRuleConditions: [] + }; + } + audienceIds.forEach(audienceId => { + evaluatedCampaignTargets[activityId][ruleSatisfied ? "matchedSegmentIds" : "unmatchedSegmentIds"].add(audienceId); + }); + evaluatedCampaignTargets[activityId][ruleSatisfied ? "matchedRuleConditions" : "unmatchedRuleConditions"].push(rule.condition); } - if (isNotBlank(server)) { - result.trackingServer = server; + function traceRuleEvaluated(rule, mboxRequest, requestType, ruleContext, ruleSatisfied) { + addCampaign(rule, ruleSatisfied); + addEvaluatedCampaignTarget(rule, ruleContext, ruleSatisfied); } - if (!isNil(trackingServerSecure)) { - result.trackingServerSecure = trackingServerSecure; + function traceNotification(rule) { + const { + meta + } = rule; + const activityId = meta[ACTIVITY_ID]; + if (!(campaigns[activityId].notifications instanceof Array)) { + campaigns[activityId].notifications = []; + } + return notification => { + campaigns[activityId].notifications.push(notification); + }; } - if (isNotBlank(serverSecure)) { - result.trackingServerSecure = serverSecure; + function toJSON() { + return { + campaigns: values(campaigns).sort(byOrder).map(campaign => { + const result = _objectSpread2({}, campaign); + delete result.order; + return result; + }), + evaluatedCampaignTargets: values(evaluatedCampaignTargets).sort(byOrder).map(evaluatedCampaignTarget => { + const result = _objectSpread2(_objectSpread2({}, evaluatedCampaignTarget), {}, { + matchedSegmentIds: [...evaluatedCampaignTarget.matchedSegmentIds], + unmatchedSegmentIds: [...evaluatedCampaignTarget.unmatchedSegmentIds] + }); + delete result.order; + return result; + }), + request + }; } - if (isEmpty(result)) { - return null; + function getTraceResult() { + return traceProvider.wrap(toJSON()); } - return result; + return { + toJSON, + traceRuleEvaluated, + traceRequest, + traceNotification, + getTraceResult + }; } - function createDeliveryRequest(request, visitorValues, providersParams) { - const allParams = getAllParams(providersParams); - const deviceId = getDeviceId(); - const thirdPartyId = getThirdPartyId(allParams); - const customerIdsValues = getCustomerIdsVisitorValues(); - const visitorId = createVisitorId(request.id || {}, deviceId, thirdPartyId, visitorValues, customerIdsValues); - const property = createProperty(request.property, allParams); - const experienceCloud = createExperienceCloud(request.experienceCloud || {}, visitorValues); - const trace = createTrace$1(request.trace); - const preview = createPreview(request.preview); - const qaMode = createQaMode(request.qaMode); - const execute = createExecute(request, allParams, providersParams); - const prefetch = createPrefetch(request, allParams, providersParams); - const { - notifications - } = request; - const result = {}; - result.requestId = uuid(); - result.context = createContext(request.context); - if (!isEmpty(visitorId)) { - result.id = visitorId; - } - if (!isEmpty(property)) { - result.property = property; - } - if (!isEmpty(trace)) { - result.trace = trace; - } - if (!isEmpty(experienceCloud)) { - result.experienceCloud = experienceCloud; - } - if (!isEmpty(preview)) { - result.preview = preview; - } - if (!isEmpty(qaMode)) { - result.qaMode = qaMode; + function ArtifactTracer(artifactLocation, artifactPayload, pollingInterval, pollingHalted, firstArtifact) { + let artifact = firstArtifact; + let artifactRetrievalCount = 1; + let artifactLastRetrieved = new Date(); + function provideNewArtifact(value) { + artifactLastRetrieved = new Date(); + artifactRetrievalCount += 1; + artifact = value; } - if (!isEmpty(execute)) { - result.execute = execute; + const meta = isDefined(artifact) ? artifact.meta : {}; + function toJSON() { + return _objectSpread2({ + artifactLocation: isObject(artifactPayload) ? Messages.NOT_APPLICABLE : artifactLocation, + pollingInterval, + pollingHalted, + artifactVersion: isDefined(artifact) ? artifact.version : Messages.UNKNOWN, + artifactRetrievalCount, + artifactLastRetrieved: artifactLastRetrieved.toISOString() + }, meta); } - if (!isEmpty(prefetch)) { - result.prefetch = prefetch; + return { + provideNewArtifact, + toJSON + }; + } + + const RequestType = { + MBOX: "mbox", + VIEW: "view", + PAGELOAD: "pageLoad" + }; + const OptionType = { + Html: "html", + Json: "json", + Redirect: "redirect", + Dynamic: "dynamic", + Actions: "actions" + }; + + const MACRO_PATTERN_REGEX = /\$\{([a-zA-Z0-9_.]*?)\}/gi; + const MACRO_NAME_REPLACEMENTS = { + campaign: "activity", + recipe: "experience" + }; + const MACRO_NAME_REPLACEMENTS_REGEX = new RegExp(Object.keys(MACRO_NAME_REPLACEMENTS).join("|"), "gi"); + const MACRO_NAME_REMOVALS = ["mbox"]; + function noBlankOptions(option) { + return !(isUndefined(option.type) && isUndefined(option.content)); + } + function prepareExecuteResponse(rule, mboxResponse, requestType, requestDetail, tracer) { + const { + metrics = [], + options = [] + } = mboxResponse; + const result = _objectSpread2(_objectSpread2({}, mboxResponse), {}, { + options: options.filter(noBlankOptions).map(pristineOption => { + const option = _objectSpread2({}, pristineOption); + delete option.eventToken; + return option; + }), + metrics: metrics.filter(metric => metric.type === MetricType.Click) + }); + if (result.metrics.length === 0) { + delete result.metrics; } - if (!isEmpty(notifications)) { - result.notifications = notifications; + return result; + } + function preparePrefetchResponse(rule, mboxResponse, requestType, requestDetail, tracer) { + const { + options = [] + } = mboxResponse; + const result = _objectSpread2(_objectSpread2({}, mboxResponse), {}, { + options: options.map((pristineOption, idx) => { + let { + eventToken + } = pristineOption; + if (isUndefined(eventToken) && mboxResponse.metrics.length > idx && mboxResponse.metrics[idx].type === MetricType.Display) { + eventToken = mboxResponse.metrics[idx].eventToken; + } + return _objectSpread2(_objectSpread2({}, pristineOption), {}, { + eventToken + }); + }) + }); + if (requestType !== RequestType.VIEW) { + delete result.metrics; } return result; } - function buildRequest(request, params, data) { - const visitorValues = data[0]; - const providersValues = data[1]; - const providersParams = reactorObjectAssign({}, providersValues, params); - return createDeliveryRequest(request, visitorValues, providersParams); + function addTrace(rule, mboxResponse, requestType, requestDetail, tracer) { + return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { + trace: tracer.getTraceResult() + }); } - function createAsyncDeliveryRequest(request, params) { - return getAsyncThirdPartyData().then(data => buildRequest(request, params, data)); + function cleanUp(rule, mboxResponse, requestType, requestDetail, tracer) { + const result = objectWithoutUndefinedValues(mboxResponse); + return result; } - function createSyncDeliveryRequest(request, params) { - const data = getSyncThirdPartyData(); - return buildRequest(request, params, data); + function removePageLoadAttributes(rule, mboxResponse, requestType, requestDetail, tracer) { + const processed = _objectSpread2({}, mboxResponse); + delete processed.index; + delete processed.name; + delete processed.trace; + return processed; } - function getTimeout(config, timeout) { - if (!isNumber(timeout)) { - return config[TIMEOUT]; + function createResponseTokensPostProcessor(context) { + let responseTokensInArtifact = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + const responseTokens = {}; + responseTokens[ACTIVITY_DECISIONING_METHOD] = "on-device"; + if (includes(GEO_CITY, responseTokensInArtifact) && isDefined(context.geo.city)) { + responseTokens[GEO_CITY] = context.geo.city; } - if (timeout < 0) { - return config[TIMEOUT]; + if (includes(GEO_COUNTRY, responseTokensInArtifact) && isDefined(context.geo.country)) { + responseTokens[GEO_COUNTRY] = context.geo.country; } - return timeout; - } - function getServerDomain(config) { - const serverDomain = config[SERVER_DOMAIN]; - const overrideMboxEdgeServer = config[OVERRIDE_MBOX_EDGE_SERVER]; - if (!overrideMboxEdgeServer) { - return serverDomain; + if (includes(GEO_STATE, responseTokensInArtifact) && isDefined(context.geo.region)) { + responseTokens[GEO_STATE] = context.geo.region; } - const cluster = getEdgeCluster(); - if (isBlank(cluster)) { - return serverDomain; + if (includes(GEO_LATITUDE, responseTokensInArtifact) && isDefined(context.geo.latitude)) { + responseTokens[GEO_LATITUDE] = context.geo.latitude; } - return "" + EDGE_SERVER_PREFIX + cluster + EDGE_SERVER_DOMAIN; - } - function createRequestUrl(config) { - const scheme = config[SCHEME]; - const host = getServerDomain(config); - const path = config[ENDPOINT]; - const client = config[CLIENT_CODE]; - const sessionId = getSessionId(); - const version = config[VERSION]; - const queryString = stringifyQueryString({ - client, - sessionId, - version - }); - return scheme + "//" + host + path + "?" + queryString; - } - function executeDeliveryRequest(request, requestTimeout) { - const config = getConfig(); - const url = createRequestUrl(config); - const headers = { - [CONTENT_TYPE]: [TEXT_PLAIN] + if (includes(GEO_LONGITUDE, responseTokensInArtifact) && isDefined(context.geo.longitude)) { + responseTokens[GEO_LONGITUDE] = context.geo.longitude; + } + return function addResponseTokens(rule, mboxResponse) { + const meta = rule.meta || {}; + const responseTokensFromMeta = [ACTIVITY_ID, ACTIVITY_NAME, ACTIVITY_TYPE, EXPERIENCE_ID, EXPERIENCE_NAME, LOCATION_ID, LOCATION_NAME, LOCATION_TYPE, OFFER_ID, OFFER_NAME, OPTION_ID, OPTION_NAME].reduce((accumulator, key) => { + if (includes(key, responseTokensInArtifact) && isDefined(meta[key])) { + accumulator[key] = meta[key]; + } + return accumulator; + }, {}); + const options = mboxResponse.options.map(option => _objectSpread2(_objectSpread2({}, option), {}, { + responseTokens: _objectSpread2(_objectSpread2({}, responseTokensFromMeta), responseTokens) + })); + return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { + options + }); }; - const timeout = getTimeout(config, requestTimeout); - const async = true; - const options = { - url, - headers, - body: request, - timeout, - async - }; - return executeXhr(options).then(response => { - return reactorObjectAssign(response, { - decisioningMethod: DECISIONING_METHOD.SERVER_SIDE - }); - }); } - function executeRequest(options, request, requestTimeout) { - logDebug(REQUEST, request); - addClientTrace({ - request - }); - return executeDeliveryRequest(request, requestTimeout).then(response => { - logDebug(RESPONSE, response); - addClientTrace({ - response + function replaceCampaignMacros(rule, mboxResponse, requestType, requestDetail, tracer) { + function addCampainMacroValues(htmlContent) { + if (isUndefined(htmlContent) || !isString(htmlContent)) { + return htmlContent; + } + return htmlContent.replace(MACRO_PATTERN_REGEX, (defaultValue, macroKey) => { + let parts = macroKey.replace(MACRO_NAME_REPLACEMENTS_REGEX, matched => MACRO_NAME_REPLACEMENTS[matched]).split("."); + if (parts.length > 2) { + parts = parts.slice(parts.length - 2); + } + const key = parts.filter(part => !includes(part, MACRO_NAME_REMOVALS)).join("."); + const { + parameters = {} + } = requestDetail; + return firstMatch(key, [rule.meta, requestDetail, parameters], defaultValue); }); - return { - request, - response - }; - }); - } - - const prop = key => obj => obj[key]; - const not = pred => val => !pred(val); - const notNil = not(isNil); - const notBlank = not(isBlank); - const filterBy = pred => coll => filter(pred, coll); - const isError = val => val.status === ERROR; - const isActions = val => val.type === ACTIONS; - const isRedirect = val => val.type === REDIRECT; - const filterNotNil = filterBy(notNil); - const filterNotBlank = filterBy(notBlank); - const selectOptions = prop(OPTIONS); - const selectContent = prop(CONTENT); - const selectEventToken = prop(EVENT_TOKEN); - const selectResponseTokens = prop(RESPONSE_TOKENS); - const hasName = val => isNotBlank(val.name); - const hasIndex = val => !isNil(val.index); - const isValidMbox = val => isObject(val) && hasName(val); - const isValidPrefetchMbox = val => isObject(val) && hasName(val) && hasIndex(val); - const isValidView = val => isObject(val) && hasName(val); - const hasSelector = val => isNotBlank(val.selector); - const selectData = prop(DATA); - const hasData = flow([selectData, notNil]); - function createSuccess(type, data) { - return { - status: SUCCESS, - type, - data - }; - } - function createError(type, data) { - return { - status: ERROR, - type, - data - }; - } - function isValidOption(option) { - return isObject(option); - } - function isValidOptionEventToken(option) { - if (!isValidOption(option)) { - return false; - } - return isNotBlank(option.eventToken); - } - function isValidMetric(metric) { - if (isEmpty(metric) || isBlank(metric.type)) { - return false; - } - return isNotBlank(metric.eventToken); - } - function isValidSelectorMetric(metric) { - if (!isValidMetric(metric)) { - return false; - } - return isNotBlank(metric.selector); - } - function isErrorWithMessage(err, msg) { - return err instanceof Error && err.message === msg; - } - - function hasDeviceId(res) { - const { - id - } = res; - return isObject(id) && isNotBlank(id.tntId); - } - function handleDeviceId(context) { - const { - response - } = context; - if (hasDeviceId(response)) { - setDeviceId(response.id.tntId); - } - return context; - } - - function handleEdgeCluster(context) { - const { - response - } = context; - if (hasDeviceId(response)) { - const { - id - } = response; - const { - tntId - } = id; - setEdgeCluster(tntId); - } - setEdgeCluster(null); - return context; - } - - function addTraceIfExists(item = {}) { - const { - trace - } = item; - if (!isEmpty(trace)) { - addServerTrace(trace); - } - } - function handleTraces(httpContext) { - const { - response - } = httpContext; - const { - execute = {}, - prefetch = {}, - notifications = {} - } = response; - const { - pageLoad = {}, - mboxes = [] - } = execute; - const { - mboxes: prefetchMboxes = [], - views = [] - } = prefetch; - addTraceIfExists(pageLoad); - forEach(addTraceIfExists, mboxes); - forEach(addTraceIfExists, prefetchMboxes); - forEach(addTraceIfExists, views); - forEach(addTraceIfExists, notifications); - return httpContext; - } - - const SDID_PARAM = "adobe_mc_sdid"; - function getRedirectUriParams(uri) { - const result = uri.queryKey; - const param = result[SDID_PARAM]; - if (!isString(param)) { - return result; - } - if (isBlank(param)) { - return result; } - const nowInSeconds = Math.round(now() / 1000); - result[SDID_PARAM] = param.replace(/\|TS=\d+/, "|TS=" + nowInSeconds); - return result; - } - function getUriParams(uri) { - return uri.queryKey; - } - function createUrlInternal(url, params, uriParamsFunc) { - const parsedUri = parseUri$1(url); - const { - protocol - } = parsedUri; - const { - host - } = parsedUri; - const { - path - } = parsedUri; - const port = parsedUri.port === "" ? "" : ":" + parsedUri.port; - const anchor = isBlank(parsedUri.anchor) ? "" : "#" + parsedUri.anchor; - const uriParams = uriParamsFunc(parsedUri); - const queryString = stringifyQueryString(reactorObjectAssign({}, uriParams, params)); - const query = isBlank(queryString) ? "" : "?" + queryString; - return protocol + "://" + host + port + path + query + anchor; - } - function createRedirectUrl(url, params) { - return createUrlInternal(url, params, getRedirectUriParams); - } - function createUrl(url, params) { - return createUrlInternal(url, params, getUriParams); + return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { + options: mboxResponse.options.map( + option => { + if (option.type === OptionType.Html) { + return _objectSpread2(_objectSpread2({}, option), {}, { + content: addCampainMacroValues(option.content) + }); + } + if (option.type === OptionType.Actions) { + return _objectSpread2(_objectSpread2({}, option), {}, { + content: option.content.map(action => _objectSpread2(_objectSpread2({}, action), {}, { + content: addCampainMacroValues(action.content) + })) + }); + } + return option; + }) + }); } - function createRedirectOption(option) { - const url = option.content; - if (isBlank(url)) { - logDebug(EMPTY_URL, option); - return null; - } - const result = reactorObjectAssign({}, option); - result.content = createRedirectUrl(url, {}); - return result; - } + var logic = {exports: {}}; - const NETWORK_ERROR$1 = "Network request failed"; - const REQUEST_TIMEOUT$1 = "Request timed out"; - const URL_REQUIRED = "URL is required"; - const GET = "GET"; - const POST$1 = "POST"; - const METHOD = "method"; - const URL = "url"; - const HEADERS = "headers"; - const DATA$1 = "data"; - const CREDENTIALS = "credentials"; - const TIMEOUT$1 = "timeout"; - const ASYNC = "async"; - function throwError(message) { - throw new Error(message); - } - function processOptions(options) { - const method = options[METHOD] || GET; - const url = options[URL] || throwError(URL_REQUIRED); - const headers = options[HEADERS] || {}; - const data = options[DATA$1] || null; - const credentials = options[CREDENTIALS] || false; - const timeout = options[TIMEOUT$1] || 3000; - const async = isNil(options[ASYNC]) ? true : options[ASYNC] === true; - const result = {}; - result[METHOD] = method; - result[URL] = url; - result[HEADERS] = headers; - result[DATA$1] = data; - result[CREDENTIALS] = credentials; - result[TIMEOUT$1] = timeout; - result[ASYNC] = async; - return result; - } - function addOnload$1(xhr, resolve, reject) { - xhr.onload = () => { - const status = xhr.status === 1223 ? 204 : xhr.status; - if (status < 100 || status > 599) { - reject(new Error(NETWORK_ERROR$1)); - return; + (function (module, exports) { + (function (root, factory) { + { + module.exports = factory(); } - const response = xhr.responseText; - const headers = xhr.getAllResponseHeaders(); - const result = { - status, - headers, - response - }; - resolve(result); - }; - return xhr; - } - function addOnerror$1(xhr, reject) { - xhr.onerror = () => { - reject(new Error(NETWORK_ERROR$1)); - }; - return xhr; - } - function addOntimeout$1(xhr, timeout, reject) { - xhr.timeout = timeout; - xhr.ontimeout = () => { - reject(new Error(REQUEST_TIMEOUT$1)); - }; - return xhr; - } - function addCredentials(xhr, credentials) { - if (credentials === true) { - xhr.withCredentials = credentials; - } - return xhr; - } - function addHeaders$1(xhr, headers) { - forEach((value, key) => { - forEach(v => xhr.setRequestHeader(key, v), value); - }, headers); - return xhr; - } - function createXhrPromise(win, opts) { - const options = processOptions(opts); - const method = options[METHOD]; - const url = options[URL]; - const headers = options[HEADERS]; - const data = options[DATA$1]; - const credentials = options[CREDENTIALS]; - const timeout = options[TIMEOUT$1]; - const async = options[ASYNC]; - return create((resolve, reject) => { - let xhr = new win.XMLHttpRequest(); - xhr = addOnload$1(xhr, resolve, reject); - xhr = addOnerror$1(xhr, reject); - xhr.open(method, url, async); - xhr = addCredentials(xhr, credentials); - xhr = addHeaders$1(xhr, headers); - if (async) { - xhr = addOntimeout$1(xhr, timeout, reject); + })(commonjsGlobal$1, function () { + if (!Array.isArray) { + Array.isArray = function (arg) { + return Object.prototype.toString.call(arg) === "[object Array]"; + }; } - xhr.send(data); - }); - } - - function xhr(options) { - return createXhrPromise(window, options); - } - - function createOptions(url, params, timeout) { - const result = {}; - result[METHOD] = GET; - result[URL] = createUrl(url, params); - result[TIMEOUT$1] = timeout; - return result; - } - function isSuccess(status) { - return status >= 200 && status < 300 || status === 304; - } - function createOption(res) { - const { - status - } = res; - if (!isSuccess(status)) { - return null; - } - const content = res.response; - if (isBlank(content)) { - return null; - } - const result = {}; - result.type = HTML; - result.content = content; - return result; - } - function createHtmlOption(option) { - const { - content - } = option; - const config = getConfig(); - const timeout = config[TIMEOUT$1]; - return xhr(createOptions(content, {}, timeout)).then(createOption)['catch'](() => null); - } - - const CLICK_TRACK_PATTERN = /CLKTRK#(\S+)/; - const CLICK_TRACK_REPLACE_PATTERN = /CLKTRK#(\S+)\s/; - function getClickTrackNodeId(action) { - const selector = action[SELECTOR]; - if (isBlank(selector)) { - return ""; - } - const result = CLICK_TRACK_PATTERN.exec(selector); - if (isEmpty(result) || result.length !== 2) { - return ""; - } - return result[1]; - } - function getContent(id, content) { - const div = document.createElement(DIV_TAG); - div.innerHTML = content; - const firstElement = div.firstElementChild; - if (isNil(firstElement)) { - return content; - } - firstElement.id = id; - return firstElement.outerHTML; - } - function processClickTrackId(action) { - const content = action[CONTENT]; - const nodeId = getClickTrackNodeId(action); - if (isBlank(nodeId) || isBlank(content)) { - return action; - } - const selector = action[SELECTOR]; - action[SELECTOR] = selector.replace(CLICK_TRACK_REPLACE_PATTERN, ""); - action[CONTENT] = getContent(nodeId, content); - return action; - } - - const notNull$1 = val => !isNil(val); - function hasSelector$1(action) { - const { - selector - } = action; - return !isNil(selector); - } - function setHtml$1(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function setText$1(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function appendHtml(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function prependHtml(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function replaceHtml(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function insertBefore(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function insertAfter(action) { - if (!hasSelector$1(action)) { - return null; - } - const result = processClickTrackId(action); - const content = result[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, result); - return null; - } - return result; - } - function customCode(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_CONTENT, action); - return null; - } - return action; - } - function setAttribute(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isObject(content)) { - logDebug(EMPTY_ATTRIBUTE, action); - return null; - } - return action; - } - function setImageSource(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isString(content)) { - logDebug(EMPTY_IMAGE_URL, action); - return null; - } - return action; - } - function setStyle(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isObject(content)) { - logDebug(EMPTY_PROPERTY, action); - return null; - } - return action; - } - function resize(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isObject(content)) { - logDebug(EMPTY_SIZES, action); - return null; - } - return action; - } - function move(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isObject(content)) { - logDebug(EMPTY_COORDINATES, action); - return null; - } - return action; - } - function remove$1(action) { - if (!hasSelector$1(action)) { - return null; - } - return action; - } - function rearrange(action) { - if (!hasSelector$1(action)) { - return null; - } - const content = action[CONTENT]; - if (!isObject(content)) { - logDebug(EMPTY_REARRANGE, action); - return null; - } - return action; - } - function redirect(action) { - const { - content - } = action; - if (isBlank(content)) { - logDebug(EMPTY_URL, action); - return null; - } - action.content = createRedirectUrl(content, {}); - return action; - } - function processAction(action) { - const type = action[TYPE]; - if (isBlank(type)) { - return null; - } - switch (type) { - case SET_HTML: - return setHtml$1(action); - case SET_TEXT: - return setText$1(action); - case APPEND_HTML: - return appendHtml(action); - case PREPEND_HTML: - return prependHtml(action); - case REPLACE_HTML: - return replaceHtml(action); - case INSERT_BEFORE: - return insertBefore(action); - case INSERT_AFTER: - return insertAfter(action); - case CUSTOM_CODE: - return customCode(action); - case SET_ATTRIBUTE: - return setAttribute(action); - case SET_IMAGE_SOURCE: - return setImageSource(action); - case SET_STYLE: - return setStyle(action); - case RESIZE: - return resize(action); - case MOVE: - return move(action); - case REMOVE: - return remove$1(action); - case REARRANGE: - return rearrange(action); - case REDIRECT: - return redirect(action); - default: - return null; - } - } - function createActionsOption(option) { - const actions = option[CONTENT]; - if (!isArray(actions)) { - return null; - } - if (isEmpty(actions)) { - return null; - } - const processedActions = filter(notNull$1, map(processAction, actions)); - if (isEmpty(processedActions)) { - return null; - } - const result = reactorObjectAssign({}, option); - result.content = processedActions; - return result; - } - - function getTokens(value = {}) { - const { - options - } = value; - if (!isArray(options)) { - return []; - } - if (isEmpty(options)) { - return []; - } - return filterNotNil(map(selectResponseTokens, options)); - } - function getResponseTokens(response = {}) { - const { - execute = {}, - prefetch = {} - } = response; - const { - pageLoad = {}, - mboxes = [] - } = execute; - const { - mboxes: prefetchMboxes = [], - views = [] - } = prefetch; - const pageLoadTokens = getTokens(pageLoad); - const mboxesTokens = flatten(map(getTokens, mboxes)); - const prefetchMboxesTokens = flatten(map(getTokens, prefetchMboxes)); - const viewsTokens = flatten(map(getTokens, views)); - return flatten([pageLoadTokens, mboxesTokens, prefetchMboxesTokens, viewsTokens]); - } - - function getRedirect(response = {}) { - const { - execute = {} - } = response; - const { - pageLoad = {}, - mboxes = [] - } = execute; - const pageLoadOpts = selectOptions(pageLoad) || []; - const mboxesOpts = flatten(filterNotNil(map(selectOptions, mboxes))); - const options = flatten([pageLoadOpts, mboxesOpts]); - const actions = flatten(map(selectContent, filter(isActions, options))); - const redirectOptions = filter(isRedirect, options); - const redirectActions = filter(isRedirect, actions); - const redirects = redirectOptions.concat(redirectActions); - const result = {}; - if (isEmpty(redirects)) { - return result; - } - const redirect = redirects[0]; - const url = redirect.content; - if (isBlank(url)) { - return result; - } - result.url = url; - return result; - } - - function getAnalytics(item = {}) { - const { - analytics - } = item; - return isEmpty(analytics) ? [] : [analytics]; - } - function getAnalyticsDetails(response = {}) { - const { - execute = {}, - prefetch = {} - } = response; - const { - pageLoad = {}, - mboxes = [] - } = execute; - const { - mboxes: prefetchMboxes = [], - views = [], - metrics = [] - } = prefetch; - const pageLoadDetails = getAnalytics(pageLoad); - const mboxesDetails = flatten(map(getAnalytics, mboxes)); - const prefetchMboxesDetails = flatten(map(getAnalytics, prefetchMboxes)); - const viewsDetails = flatten(map(getAnalytics, views)); - const prefetchMetrics = flatten(map(getAnalytics, metrics)); - return flatten([pageLoadDetails, mboxesDetails, prefetchMboxesDetails, viewsDetails, prefetchMetrics]); - } - - function addContextDetails(to, from) { - to.parameters = from.parameters; - to.profileParameters = from.profileParameters; - to.order = from.order; - to.product = from.product; - } - function addOptionsAndMetrics(result, arr) { - const options = arr[0]; - const metrics = arr[1]; - const hasOptions = !isEmpty(options); - const hasMetrics = !isEmpty(metrics); - if (!hasOptions && !hasMetrics) { - return result; - } - if (hasOptions) { - result.options = options; - } - if (hasMetrics) { - result.metrics = metrics; - } - return result; - } - function processOption(option) { - const { - type - } = option; - switch (type) { - case REDIRECT: - return resolve$1(createRedirectOption(option)); - case DYNAMIC: - return createHtmlOption(option); - case ACTIONS: - return resolve$1(createActionsOption(option)); - default: - return resolve$1(option); - } - } - function processOptions$1(options, predicate) { - if (!isArray(options)) { - return resolve$1([]); - } - if (isEmpty(options)) { - return resolve$1([]); - } - const validOptions = filter(predicate, options); - if (isEmpty(validOptions)) { - return resolve$1([]); - } - const optionsPromises = map(opt => processOption(opt), validOptions); - return all(optionsPromises).then(filterNotNil); - } - function processMetrics(metrics, predicate) { - if (!isArray(metrics)) { - return resolve$1([]); - } - if (isEmpty(metrics)) { - return resolve$1([]); - } - return resolve$1(filter(predicate, metrics)); - } - function processPageLoad(httpContext) { - const { - response - } = httpContext; - const { - execute - } = response; - if (!isObject(execute)) { - return resolve$1(null); - } - const { - pageLoad - } = execute; - if (!isObject(pageLoad)) { - return resolve$1(null); - } - const { - analytics, - options, - metrics - } = pageLoad; - const result = { - analytics - }; - return all([processOptions$1(options, isValidOption), processMetrics(metrics, isValidSelectorMetric)]).then(arr => addOptionsAndMetrics(result, arr)); - } - function processExecuteMbox(item) { - const { - name, - analytics, - options, - metrics - } = item; - const result = { - name, - analytics - }; - return all([processOptions$1(options, isValidOption), processMetrics(metrics, isValidMetric)]).then(arr => addOptionsAndMetrics(result, arr)); - } - function processExecuteMboxes(httpContext) { - const { - response - } = httpContext; - const { - execute - } = response; - if (!isObject(execute)) { - return resolve$1([]); - } - const { - mboxes - } = execute; - if (!isArray(mboxes) || isEmpty(mboxes)) { - return resolve$1([]); - } - const validMboxes = filter(isValidMbox, mboxes); - return all(map(processExecuteMbox, validMboxes)).then(filterNotNil); - } - function sameMbox(mbox, index, name) { - return mbox.index === index && mbox.name === name; - } - function getRequestMbox(request, index, name) { - const { - prefetch = {} - } = request; - const { - mboxes = [] - } = prefetch; - if (isEmpty(mboxes)) { - return null; - } - return first(filter(item => sameMbox(item, index, name), mboxes)); - } - function processPrefetchMbox(request, item) { - const { - index, - name, - state, - analytics, - options, - metrics - } = item; - const requestMbox = getRequestMbox(request, index, name); - const result = { - name, - state, - analytics - }; - if (!isNil(requestMbox)) { - addContextDetails(result, requestMbox); - } - return all([processOptions$1(options, isValidOptionEventToken), processMetrics(metrics, isValidMetric)]).then(arr => addOptionsAndMetrics(result, arr)); - } - function processPrefetchMboxes(httpContext) { - const { - request, - response - } = httpContext; - const { - prefetch - } = response; - if (!isObject(prefetch)) { - return resolve$1([]); - } - const { - mboxes - } = prefetch; - if (!isArray(mboxes) || isEmpty(mboxes)) { - return resolve$1([]); - } - const validMboxes = filter(isValidPrefetchMbox, mboxes); - const process = item => processPrefetchMbox(request, item); - return all(map(process, validMboxes)).then(filterNotNil); - } - function getRequestView(request) { - const { - prefetch = {} - } = request; - const { - views = [] - } = prefetch; - if (isEmpty(views)) { - return null; - } - return views[0]; - } - function processView(request, view) { - const { - name, - state, - analytics, - options, - metrics - } = view; - const requestView = getRequestView(request); - const result = { - name: name.toLowerCase(), - state, - analytics - }; - if (!isNil(requestView)) { - addContextDetails(result, requestView); - } - return all([processOptions$1(options, isValidOptionEventToken), processMetrics(metrics, isValidSelectorMetric)]).then(arr => addOptionsAndMetrics(result, arr)); - } - function processPrefetchViews(httpContext) { - const { - request, - response - } = httpContext; - const { - prefetch - } = response; - if (!isObject(prefetch)) { - return resolve$1([]); - } - const { - views - } = prefetch; - if (!isArray(views) || isEmpty(views)) { - return resolve$1([]); - } - const validViews = filter(isValidView, views); - const process = view => processView(request, view); - return all(map(process, validViews)).then(filterNotNil); - } - function processPrefetchMetrics(httpContext) { - const { - response - } = httpContext; - const { - prefetch - } = response; - if (!isObject(prefetch)) { - return resolve$1([]); - } - const { - metrics - } = prefetch; - return processMetrics(metrics, isValidSelectorMetric); - } - function processMeta(httpContext) { - const { - response - } = httpContext; - const { - remoteMboxes, - remoteViews, - decisioningMethod - } = response; - const meta = {}; - if (isObject(remoteMboxes)) { - meta.remoteMboxes = remoteMboxes; - } - if (isObject(remoteViews)) { - meta.remoteViews = remoteViews; - } - if (isString(decisioningMethod)) { - meta.decisioningMethod = decisioningMethod; - } - return resolve$1(meta); - } - function processNotification(notification) { - if (isNil(notification) || isBlank(notification.id)) { - return resolve$1(null); - } - const { - id - } = notification; - return resolve$1({ - id - }); - } - function processNotifications(httpContext) { - const { - response - } = httpContext; - const { - notifications - } = response; - if (!isArray(notifications)) { - return resolve$1([]); - } - return all(map(processNotification, notifications)).then(filterNotNil); - } - function createResponseContext(arr) { - const pageLoad = arr[0]; - const mboxes = arr[1]; - const prefetchMboxes = arr[2]; - const views = arr[3]; - const prefetchMetrics = arr[4]; - const meta = arr[5]; - const notifications = arr[6]; - const result = {}; - const execute = {}; - if (isObject(pageLoad)) { - execute.pageLoad = pageLoad; - } - if (!isEmpty(mboxes)) { - execute.mboxes = mboxes; - } - const prefetch = {}; - if (!isEmpty(prefetchMboxes)) { - prefetch.mboxes = prefetchMboxes; - } - if (!isEmpty(views)) { - prefetch.views = views; - } - if (!isEmpty(prefetchMetrics)) { - prefetch.metrics = prefetchMetrics; - } - if (!isEmpty(execute)) { - result.execute = execute; - } - if (!isEmpty(prefetch)) { - result.prefetch = prefetch; - } - if (!isEmpty(meta)) { - result.meta = meta; - } - if (!isEmpty(notifications)) { - result.notifications = notifications; - } - return result; - } - function processResponse(httpContext) { - const handlers = [handleTraces, handleDeviceId, handleEdgeCluster]; - const context = flow(handlers)(httpContext); - const pageLoad = processPageLoad(context); - const mboxes = processExecuteMboxes(context); - const prefetchMboxes = processPrefetchMboxes(context); - const views = processPrefetchViews(context); - const prefetchMetrics = processPrefetchMetrics(context); - const meta = processMeta(context); - const notifications = processNotifications(context); - const promises = [pageLoad, mboxes, prefetchMboxes, views, prefetchMetrics, meta, notifications]; - return all(promises).then(createResponseContext); - } - - function hasRedirect(response) { - const redirect = getRedirect(response); - return !isEmpty(redirect); - } - function createEventPayload(response) { - const responseTokens = getResponseTokens(response); - const payload = {}; - if (!isEmpty(responseTokens)) { - payload.responseTokens = responseTokens; - } - return payload; - } - - function handleRequestSuccess(response) { - const payload = createEventPayload(response); - const analyticsDetails = getAnalyticsDetails(response); - if (!isEmpty(analyticsDetails)) { - payload.analyticsDetails = analyticsDetails; - } - logDebug(REQUEST_SUCCEEDED, response); - notifyRequestSucceeded(payload, hasRedirect(response)); - return resolve$1(response); - } - function handleRequestError(error) { - logWarn(REQUEST_FAILED, error); - notifyRequestFailed({ - error - }); - return reject$1(error); - } - function executeGetOffers(options) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const { - consumerId = globalMbox, - request, - timeout - } = options; - const analytics = createAnalytics(consumerId, request); - const successFunc = response => handleRequestSuccess(response); - const errorFunc = error => handleRequestError(error); - if (!isEmpty(analytics)) { - const experienceCloud = request.experienceCloud || {}; - experienceCloud.analytics = analytics; - request.experienceCloud = experienceCloud; - } - notifyRequestStart({}); - return createAsyncDeliveryRequest(request, {}).then(deliveryRequest => executeRequest(options, deliveryRequest, timeout)).then(processResponse).then(successFunc)['catch'](errorFunc); - } - - function addClass(cssClass, selector) { - return select(selector).addClass(cssClass); - } - function setCss(style, selector) { - return select(selector).css(style); - } - - function getAttr(name, selector) { - return select(selector).attr(name); - } - function setAttr(name, value, selector) { - return select(selector).attr(name, value); - } - function removeAttr(name, selector) { - return select(selector).removeAttr(name); - } - function copyAttr(from, to, selector) { - const value = getAttr(from, selector); - if (isNotBlank(value)) { - removeAttr(from, selector); - setAttr(to, value, selector); - } - } - function hasAttr(name, selector) { - return isNotBlank(getAttr(name, selector)); - } - - const VISIBILITY_STATE = "visibilityState"; - const VISIBLE = "visible"; - const DELAY = 100; - function createError$1(selector) { - return new Error("Could not find: " + selector); - } - function awaitUsingMutationObserver(selector, timeout, queryFunc) { - return create((res, rej) => { - const mo = getMutationObserver(() => { - const elems = queryFunc(selector); - if (!isEmpty(elems)) { - mo.disconnect(); - res(elems); - } - }); - delay(() => { - mo.disconnect(); - rej(createError$1(selector)); - }, timeout); - mo.observe(document, { - childList: true, - subtree: true - }); - }); - } - function canUseRequestAnimation() { - return document[VISIBILITY_STATE] === VISIBLE; - } - function awaitUsingRequestAnimation(selector, timeout, queryFunc) { - return create((res, rej) => { - function execute() { - const elems = queryFunc(selector); - if (!isEmpty(elems)) { - res(elems); - return; - } - window.requestAnimationFrame(execute); - } - execute(); - delay(() => { - rej(createError$1(selector)); - }, timeout); - }); - } - function awaitUsingTimer(selector, timeout, queryFunc) { - return create((res, rej) => { - function execute() { - const elems = queryFunc(selector); - if (!isEmpty(elems)) { - res(elems); - return; - } - delay(execute, DELAY); - } - execute(); - delay(() => { - rej(createError$1(selector)); - }, timeout); - }); - } - function awaitSelector(selector, timeout = getConfig()[SELECTORS_POLLING_TIMEOUT], queryFunc = select) { - const elems = queryFunc(selector); - if (!isEmpty(elems)) { - return resolve$1(elems); - } - if (canUseMutationObserver()) { - return awaitUsingMutationObserver(selector, timeout, queryFunc); - } - if (canUseRequestAnimation()) { - return awaitUsingRequestAnimation(selector, timeout, queryFunc); - } - return awaitUsingTimer(selector, timeout, queryFunc); - } - - function getDataSrc(item) { - return getAttr(DATA_SRC, item); - } - function hasDataSrc(item) { - return hasAttr(DATA_SRC, item); - } - function disableImages(html) { - forEach(item => copyAttr(SRC, DATA_SRC, item), toArray(find(IMAGE_TAG, html))); - return html; - } - function enableImages(html) { - forEach(item => copyAttr(DATA_SRC, SRC, item), toArray(find(IMAGE_TAG, html))); - return html; - } - function loadImage(src) { - logDebug(LOADING_IMAGE, src); - return getAttr(SRC, setAttr(SRC, src, wrap("<" + IMAGE_TAG + "/>"))); - } - function loadImages(html) { - const elements = filter(hasDataSrc, toArray(find(IMAGE_TAG, html))); - if (isEmpty(elements)) { - return html; - } - forEach(loadImage, map(getDataSrc, elements)); - return html; - } - function renderImages(html) { - return flow([disableImages, loadImages, enableImages])(html); - } - - function getUrl(item) { - const src = getAttr(SRC, item); - return isNotBlank(src) ? src : null; - } - function getScriptsUrls(html) { - return filter(isNotBlank, map(getUrl, toArray(find(SCRIPT, html)))); - } - function loadScripts(urls) { - return reduce((acc, url) => acc.then(() => { - logDebug(REMOTE_SCRIPT, url); - addClientTrace({ - remoteScript: url - }); - return reactorLoadScript(url); - }), resolve$1(), urls); - } - - function handleRenderingSuccess(action) { - return action; - } - function handleRenderingError(action, error) { - logWarn(UNEXPECTED_ERROR, error); - addClientTrace({ - action, - error - }); - return action; - } - function renderHtml(renderFunc, action) { - const container = select(action[SELECTOR]); - const html = renderImages(fragment(action[CONTENT])); - const urls = getScriptsUrls(html); - let result; - try { - result = resolve$1(renderFunc(container, html)); - } catch (err) { - return reject$1(handleRenderingError(action, err)); - } - if (isEmpty(urls)) { - return result.then(() => handleRenderingSuccess(action))['catch'](error => handleRenderingError(action, error)); - } - return result.then(() => loadScripts(urls)).then(() => handleRenderingSuccess(action))['catch'](error => handleRenderingError(action, error)); - } - - const HEAD_TAGS_SELECTOR = SCRIPT_TAG + "," + LINK_TAG + "," + STYLE_TAG; - function getHeadContent(content) { - const container = fragment(content); - const result = reduce((acc, elem) => { - acc.push(getHtml(fragment(elem))); - return acc; - }, [], toArray(find(HEAD_TAGS_SELECTOR, container))); - return join("", result); - } - function preprocessAction(action) { - const result = reactorObjectAssign({}, action); - const content = result[CONTENT]; - if (isBlank(content)) { - return result; - } - const container = select(result[SELECTOR]); - if (!is(HEAD_TAG, container)) { - return result; - } - result[TYPE] = APPEND_HTML; - result[CONTENT] = getHeadContent(content); - return result; - } - function addPxIfRequired(value) { - const hasPx = value.indexOf("px") === value.length - 2; - return hasPx ? value : value + "px"; - } - function setHtmlRenderFunc(container, html) { - return setHtml(getHtml(html), container); - } - function setHtml$2(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(setHtmlRenderFunc, action); - } - function setText$2(action) { - const container = select(action[SELECTOR]); - const content = action[CONTENT]; - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - setText(content, container); - return resolve$1(action); - } - function appendHtmlRenderFunc(container, html) { - return append(getHtml(html), container); - } - function appendHtml$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(appendHtmlRenderFunc, action); - } - function prependHtmlRenderFunc(container, html) { - return prepend(getHtml(html), container); - } - function prependHtml$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(prependHtmlRenderFunc, action); - } - function replaceHtmlRenderFunc(container, html) { - const parentContainer = parent(container); - remove(before(getHtml(html), container)); - return parentContainer; - } - function replaceHtml$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(replaceHtmlRenderFunc, action); - } - function insertBeforeRenderFunc(container, html) { - return prev(before(getHtml(html), container)); - } - function insertBefore$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(insertBeforeRenderFunc, action); - } - function insertAfterRenderFunc(container, html) { - return next(after(getHtml(html), container)); - } - function insertAfter$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(insertAfterRenderFunc, action); - } - function customCodeRenderFunc(container, html) { - return parent(before(getHtml(html), container)); - } - function customCode$1(action) { - logDebug(ACTION_RENDERING, action); - return renderHtml(customCodeRenderFunc, action); - } - function setImageSource$1(action) { - const content = action[CONTENT]; - const container = select(action[SELECTOR]); - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - removeAttr(SRC, container); - setAttr(SRC, loadImage(content), container); - return resolve$1(action); - } - function setAttribute$1(action) { - const content = action[CONTENT]; - const container = select(action[SELECTOR]); - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - forEach((value, key) => setAttr(key, value, container), content); - return resolve$1(action); - } - function setCssWithPriority(container, style, priority) { - forEach(elem => { - forEach((value, key) => elem.style.setProperty(key, value, priority), style); - }, toArray(container)); - } - function setStyle$1(action) { - const container = select(action[SELECTOR]); - const content = action[CONTENT]; - const priority = content[PRIORITY]; - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - if (isBlank(priority)) { - setCss(content, container); - } else { - setCssWithPriority(container, content, priority); - } - return resolve$1(action); - } - function resize$1(action) { - const container = select(action[SELECTOR]); - const content = action[CONTENT]; - content[WIDTH] = addPxIfRequired(content[WIDTH]); - content[HEIGHT] = addPxIfRequired(content[HEIGHT]); - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - setCss(content, container); - return resolve$1(action); - } - function move$1(action) { - const container = select(action[SELECTOR]); - const content = action[CONTENT]; - content[LEFT] = addPxIfRequired(content[LEFT]); - content[TOP] = addPxIfRequired(content[TOP]); - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - setCss(content, container); - return resolve$1(action); - } - function remove$2(action) { - const container = select(action[SELECTOR]); - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - remove(container); - return resolve$1(action); - } - function rearrange$1(action) { - const container = select(action[SELECTOR]); - const content = action[CONTENT]; - const from = Number(content[FROM]); - const to = Number(content[TO]); - if (isNaN(from) && isNaN(to)) { - logDebug(REARRANGE_INCORRECT_INDEXES, action); - return reject$1(action); - } - const elements = toArray(children(container)); - const elemFrom = elements[from]; - const elemTo = elements[to]; - if (!exists$2(elemFrom) || !exists$2(elemTo)) { - logDebug(REARRANGE_MISSING, action); - return reject$1(action); - } - logDebug(ACTION_RENDERING, action); - addClientTrace({ - action - }); - if (from < to) { - after(elemFrom, elemTo); - } else { - before(elemFrom, elemTo); - } - return resolve$1(action); - } - function executeRenderAction(action) { - const processedAction = preprocessAction(action); - const type = processedAction[TYPE]; - switch (type) { - case SET_HTML: - return setHtml$2(processedAction); - case SET_TEXT: - return setText$2(processedAction); - case APPEND_HTML: - return appendHtml$1(processedAction); - case PREPEND_HTML: - return prependHtml$1(processedAction); - case REPLACE_HTML: - return replaceHtml$1(processedAction); - case INSERT_BEFORE: - return insertBefore$1(processedAction); - case INSERT_AFTER: - return insertAfter$1(processedAction); - case CUSTOM_CODE: - return customCode$1(processedAction); - case SET_ATTRIBUTE: - return setAttribute$1(processedAction); - case SET_IMAGE_SOURCE: - return setImageSource$1(processedAction); - case SET_STYLE: - return setStyle$1(processedAction); - case RESIZE: - return resize$1(processedAction); - case MOVE: - return move$1(processedAction); - case REMOVE: - return remove$2(processedAction); - case REARRANGE: - return rearrange$1(processedAction); - default: - return resolve$1(processedAction); - } - } - - const ACTION_KEY_ATTR = "at-action-key"; - function isClickTracking(action) { - return action[TYPE] === TRACK_CLICK || action[TYPE] === SIGNAL_CLICK; - } - function hasValidSelector(action) { - const selector = action[SELECTOR]; - return isNotBlank(selector) || isElement(selector); - } - function markAsRendered(action) { - const { - key - } = action; - if (isBlank(key)) { - return; - } - if (!hasValidSelector(action)) { - return; - } - const selector = action[SELECTOR]; - setAttr(ACTION_KEY_ATTR, key, selector); - } - function removeActionCssHiding(action) { - const cssSelector = action[CSS_SELECTOR]; - if (isBlank(cssSelector)) { - return; - } - removeActionHidingStyle(cssSelector); - } - function displayAction(action) { - if (!hasValidSelector(action)) { - removeActionCssHiding(action); - return; - } - const selector = action[SELECTOR]; - if (isClickTracking(action)) { - addClass(CLICK_TRACKING_CSS_CLASS, selector); - return; - } - addClass(MARKER_CSS_CLASS, selector); - removeActionCssHiding(action); - } - function displayActions(actions) { - forEach(displayAction, actions); - } - function shouldRender(action) { - const { - key - } = action; - if (isBlank(key)) { - return true; - } - const type = action[TYPE]; - if (type === CUSTOM_CODE) { - return action[PAGE]; - } - const selector = action[SELECTOR]; - const currentKey = getAttr(ACTION_KEY_ATTR, selector); - if (currentKey !== key) { - return true; - } - if (currentKey === key) { - return !action[PAGE]; - } - return false; - } - function renderAwaitedAction(action) { - if (!shouldRender(action)) { - displayAction(action); - return action; - } - return executeRenderAction(action).then(() => { - logDebug(ACTION_RENDERED, action); - addClientTrace({ - action - }); - markAsRendered(action); - displayAction(action); - return action; - })['catch'](error => { - logWarn(UNEXPECTED_ERROR, error); - addClientTrace({ - action, - error - }); - displayAction(action); - const result = reactorObjectAssign({}, action); - result[ERROR] = true; - return result; - }); - } - function postProcess(actions) { - const errorActions = filter(e => e[ERROR] === true, actions); - if (isEmpty(errorActions)) { - return resolve$1(); - } - displayActions(errorActions); - return reject$1(actions); - } - function awaitAction(action) { - const selector = action[SELECTOR]; - return awaitSelector(selector).then(() => action)['catch'](() => { - const result = reactorObjectAssign({}, action); - result[ERROR] = true; - return result; - }); - } - function awaitAndRenderAction(action) { - return awaitAction(action).then(renderAwaitedAction); - } - function executeRenderActions(actions) { - const promises = map(awaitAndRenderAction, actions); - return all(promises).then(postProcess); - } - - function addEventListener(type, func, selector) { - return select(selector).on(type, func); - } - function removeEventListener(type, func, selector) { - return select(selector).off(type, func); - } - - const METRIC_ELEMENT_NOT_FOUND = "metric element not found"; - function executeMetric(metric) { - const selector = metric[SELECTOR]; - return awaitSelector(selector).then(() => { - addClientTrace({ - metric - }); - const foundMetric = reactorObjectAssign({ - found: true - }, metric); - return foundMetric; - })['catch'](() => { - logWarn(METRIC_ELEMENT_NOT_FOUND, metric); - addClientTrace({ - metric, - message: METRIC_ELEMENT_NOT_FOUND - }); - return metric; - }); - } - - function saveView(view) { - const key = view.name; - const views = getItem(VIEWS$1) || {}; - views[key] = view; - setItem(VIEWS$1, views); - } - function findView(key, options = {}) { - const { - page = true - } = options; - const views = getItem(VIEWS$1) || {}; - const result = views[key]; - if (isNil(result)) { - return result; - } - const { - impressionId - } = options; - if (isNil(impressionId)) { - return result; - } - return reactorObjectAssign({ - page, - impressionId - }, result); - } - function persistViews(views) { - forEach(saveView, views); - } - - const NAVIGATOR = "navigator"; - const SEND_BEACON = "sendBeacon"; - function executeSendBeacon(win, url, data) { - return win[NAVIGATOR][SEND_BEACON](url, data); - } - function executeSyncXhr(http, url, data) { - const headers = {}; - headers[CONTENT_TYPE] = [TEXT_PLAIN]; - const options = {}; - options[METHOD] = POST$1; - options[URL] = url; - options[DATA$1] = data; - options[CREDENTIALS] = true; - options[ASYNC] = false; - options[HEADERS] = headers; - try { - http(options); - } catch (error) { - return false; - } - return true; - } - function isBeaconSupported(win) { - return NAVIGATOR in win && SEND_BEACON in win[NAVIGATOR]; - } - function sendBeacon(url, data) { - if (isBeaconSupported(window)) { - return executeSendBeacon(window, url, data); - } - return executeSyncXhr(xhr, url, data); - } - - const SEND_BEACON_SUCCESS = "Beacon data sent"; - const SEND_BEACON_ERROR = "Beacon data sent failed"; - const VIEW_TRIGGERED = "View triggered notification"; - const VIEW_RENDERED = "View rendered notification"; - const MBOXES_RENDERED = "Mboxes rendered notification"; - const EVENT_HANDLER = "Event handler notification"; - const MBOX_EVENT_HANDLER = "Mbox event handler notification"; - const VIEW_EVENT_HANDLER = "View event handler notification"; - const PREFETCH_MBOXES = "prefetchMboxes"; - const RENDERED = "rendered"; - const TRIGGERED = "triggered"; - function createRequest(consumerId) { - const analytics = createAnalytics(consumerId, {}); - const request = { - context: { - beacon: true - } - }; - if (!isEmpty(analytics)) { - const experienceCloud = {}; - experienceCloud.analytics = analytics; - request.experienceCloud = experienceCloud; - } - return request; - } - function createSyncNotificationRequest(consumerId, params, notifications) { - const request = createRequest(consumerId); - const result = createSyncDeliveryRequest(request, params); - result.notifications = notifications; - return result; - } - function createAsyncNotificationRequest(consumerId, params, notifications) { - const request = createRequest(consumerId); - return createAsyncDeliveryRequest(request, params).then(result => { - result.notifications = notifications; - return result; - }); - } - function createNotification(item, type, tokens) { - const id = uuid(); - const timestamp = now(); - const { - parameters, - profileParameters, - order, - product - } = item; - const result = { - id, - type, - timestamp, - parameters, - profileParameters, - order, - product - }; - if (isEmpty(tokens)) { - return result; - } - result.tokens = tokens; - return result; - } - function createMboxNotification(mbox, type, tokens) { - const { - name, - state - } = mbox; - const notification = createNotification(mbox, type, tokens); - notification.mbox = { - name, - state - }; - return notification; - } - function createViewNotification(view, type, tokens) { - const { - name, - state - } = view; - const notification = createNotification(view, type, tokens); - notification.view = { - name, - state - }; - return notification; - } - function executeBeaconNotification(request) { - const config = getConfig(); - const url = createRequestUrl(config); - const data = JSON.stringify(request); - if (sendBeacon(url, data)) { - logDebug(SEND_BEACON_SUCCESS, url, request); - return true; - } - logWarn(SEND_BEACON_ERROR, url, request); - return false; - } - function sendEventNotification(source, type, token) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const params = getTargetPageParams(globalMbox); - const requestDetails = createRequestDetails({}, params); - const notification = createNotification(requestDetails, type, [token]); - const request = createSyncNotificationRequest(uuid(), params, [notification]); - logDebug(EVENT_HANDLER, source, notification); - addClientTrace({ - source, - event: type, - request - }); - executeBeaconNotification(request); - } - function sendMboxEventNotification(name, type, token) { - const params = getTargetPageParams(name); - const requestDetails = createRequestDetails({}, params); - const notification = createNotification(requestDetails, type, [token]); - notification.mbox = { - name - }; - const request = createSyncNotificationRequest(uuid(), params, [notification]); - logDebug(MBOX_EVENT_HANDLER, name, notification); - addClientTrace({ - mbox: name, - event: type, - request - }); - executeBeaconNotification(request); - } - function sendMboxesRenderedNotifications(items) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const notifications = []; - const type = DISPLAY_EVENT; - forEach(item => { - const { - mbox, - data - } = item; - if (isNil(data)) { - return; - } - const { - eventTokens = [] - } = data; - if (isEmpty(eventTokens)) { - return; - } - notifications.push(createMboxNotification(mbox, type, eventTokens)); - }, items); - if (isEmpty(notifications)) { - return; - } - const request = createSyncNotificationRequest(globalMbox, {}, notifications); - logDebug(MBOXES_RENDERED, notifications); - addClientTrace({ - source: PREFETCH_MBOXES, - event: RENDERED, - request - }); - executeBeaconNotification(request); - } - function sendViewEventNotification(name, type, token) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const params = getTargetPageParams(globalMbox); - const requestDetails = createRequestDetails({}, params); - const notification = createNotification(requestDetails, type, [token]); - notification.view = { - name - }; - const request = createSyncNotificationRequest(uuid(), params, [notification]); - logDebug(VIEW_EVENT_HANDLER, name, notification); - addClientTrace({ - view: name, - event: type, - request - }); - executeBeaconNotification(request); - } - function sendViewTriggeredNotifications(options) { - const { - viewName: name, - impressionId - } = options; - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - const params = getTargetPageParams(globalMbox); - const requestDetails = createRequestDetails({}, params); - const notification = createNotification(requestDetails, DISPLAY_EVENT, []); - notification.view = { - name - }; - logDebug(VIEW_TRIGGERED, name); - createAsyncNotificationRequest(name, params, [notification]).then(request => { - request.impressionId = impressionId; - addClientTrace({ - view: name, - event: TRIGGERED, - request - }); - executeBeaconNotification(request); - }); - } - function sendViewRenderedNotifications(item) { - if (isNil(item)) { - return; - } - const { - view, - data = {} - } = item; - const { - eventTokens = [] - } = data; - const { - name, - impressionId - } = view; - const persistedView = findView(name); - if (isNil(persistedView)) { - return; - } - const notification = createViewNotification(persistedView, DISPLAY_EVENT, eventTokens); - const request = createSyncNotificationRequest(name, {}, [notification]); - request.impressionId = impressionId; - logDebug(VIEW_RENDERED, name, eventTokens); - addClientTrace({ - view: name, - event: RENDERED, - request - }); - executeBeaconNotification(request); - } - - const CACHE$1 = {}; - const PAGE_LOAD$1 = "pageLoadMetrics"; - const PREFETCH = "prefetchMetrics"; - const selectMetrics = prop(METRICS); - const createMetricSuccess = () => createSuccess(METRIC); - const createMetricError = error => createError(METRIC, error); - function decorateElementIfRequired(type, selector) { - if (type !== CLICK) { - return; - } - addClass(CLICK_TRACKING_CSS_CLASS, selector); - } - function isHandlerCached(name, key) { - return !isNil(CACHE$1[name]) && !isNil(CACHE$1[name][key]); - } - function removePreviousHandlersFromCache(currentViewName, type, selector) { - if (!isNil(CACHE$1[currentViewName])) { - return; - } - const viewNames = keys(CACHE$1); - if (isEmpty(viewNames)) { - return; - } - forEach(viewName => { - const handlerNames = keys(CACHE$1[viewName]); - forEach(handlerName => { - const func = CACHE$1[viewName][handlerName]; - removeEventListener(type, func, selector); - }, handlerNames); - delete CACHE$1[viewName]; - }, viewNames); - } - function addHandlerToCache(name, key, handler) { - CACHE$1[name] = CACHE$1[name] || {}; - CACHE$1[name][key] = handler; - } - function attachEventHandler(name, fromView, metric, notifyFunc) { - const { - type, - selector, - eventToken - } = metric; - const key = hash(type + ":" + selector + ":" + eventToken); - const handler = () => notifyFunc(name, type, eventToken); - decorateElementIfRequired(type, selector); - if (!fromView) { - addEventListener(type, handler, selector); - return; - } - if (isHandlerCached(name, key)) { - return; - } - removePreviousHandlersFromCache(name, type, selector); - addHandlerToCache(name, key, handler); - addEventListener(type, handler, selector); - } - function attachMetricEventHandlers(name, fromView, metrics, notifyFunc) { - return all(map(executeMetric, metrics)).then(arr => { - forEach(metric => attachEventHandler(name, fromView, metric, notifyFunc), filter(metric => metric.found, arr)); - return createMetricSuccess(); - })['catch'](createMetricError); - } - function executeMboxMetrics(mbox) { - const { - name - } = mbox; - return attachMetricEventHandlers(name, false, selectMetrics(mbox), sendMboxEventNotification); - } - function executeViewMetrics(view) { - const { - name - } = view; - return attachMetricEventHandlers(name, true, selectMetrics(view), sendViewEventNotification); - } - function executePageLoadMetrics(pageLoad) { - return attachMetricEventHandlers(PAGE_LOAD$1, false, selectMetrics(pageLoad), sendEventNotification); - } - function executePrefetchMetrics(prefetch) { - return attachMetricEventHandlers(PREFETCH, false, selectMetrics(prefetch), sendEventNotification); - } - - const selectContent$1 = prop(CONTENT); - const selectCssSelector = prop(CSS_SELECTOR); - const createRenderSuccess = data => createSuccess(RENDER, data); - const createRenderError = error => createError(RENDER, error); - const hasNonErrorData = val => not(isError)(val) && hasData(val); - function hideActions(actions) { - const items = map(selectCssSelector, actions); - injectActionHidingStyles(filterNotBlank(items)); - } - function hideAllViewsActions(actions) { - const items = map(selectCssSelector, actions); - injectAllViewsHidingStyle(filterNotNil(items)); - } - function extractActions(item) { - const options = filter(isActions, selectOptions(item)); - return flatten(map(selectContent$1, options)); - } - function isValidAction(action) { - return isObject(action) && action.type !== SET_JSON; - } - function decorateActions(actions, key, page) { - return map(e => reactorObjectAssign({ - key, - page - }, e), filter(isValidAction, actions)); - } - function executeRendering(option, key, page) { - const { - eventToken, - responseTokens, - content - } = option; - const actions = decorateActions(content, key, page); - return executeRenderActions(actions).then(() => createRenderSuccess({ - eventToken, - responseTokens - }))['catch'](createRenderError); - } - function isValidOption$1(option) { - return isObject(option) && option.type !== JSON$1; - } - function renderOptions(func, item) { - return map(func, filter(isValidOption$1, selectOptions(item))); - } - function postExecuteRendering(key, item, values) { - const result = { - status: SUCCESS, - [key]: item - }; - const errors = map(selectData, filter(isError, values)); - const data = {}; - if (!isEmpty(errors)) { - result.status = ERROR; - data.errors = errors; - } - if (!isEmpty(data)) { - result.data = data; - } - return result; - } - function postPrefetchRendering(key, item, values) { - const result = { - status: SUCCESS, - [key]: item - }; - const errors = map(selectData, filter(isError, values)); - const renderData = map(selectData, filter(hasNonErrorData, values)); - const eventTokens = filterNotNil(map(selectEventToken, renderData)); - const responseTokens = filterNotNil(map(selectResponseTokens, renderData)); - const data = {}; - if (!isEmpty(errors)) { - result.status = ERROR; - data.errors = errors; - } - if (!isEmpty(eventTokens)) { - data.eventTokens = eventTokens; - } - if (!isEmpty(responseTokens)) { - data.responseTokens = responseTokens; - } - if (!isEmpty(data)) { - result.data = data; - } - return result; - } - function renderExecuteItem(item, postRenderingFunc, metricsFunc) { - const render = opt => executeRendering(opt, true); - const options = renderOptions(render, item); - return all(options).then(postRenderingFunc).then(result => { - metricsFunc(item); - return result; - }); - } - function renderPrefetchItem(key, item, page, metricsFunc) { - const { - name - } = item; - const render = opt => executeRendering(opt, name, page); - const options = renderOptions(render, item); - return all(options).then(arr => postPrefetchRendering(key, item, arr)).then(result => { - metricsFunc(item); - return result; - }); - } - function renderMbox(mbox) { - const postRenderingFunc = arr => postExecuteRendering(MBOX, mbox, arr); - return renderExecuteItem(mbox, postRenderingFunc, executeMboxMetrics); - } - function renderPrefetchMbox(mbox) { - return renderPrefetchItem(MBOX, mbox, true, executeMboxMetrics); - } - function hideOptions(item) { - const actions = extractActions(item); - hideActions(actions); - } - function hidePageLoadOptions(context, skipPrehiding = false) { - if (skipPrehiding) { - return; - } - const { - execute = {} - } = context; - const { - pageLoad = {} - } = execute; - if (!isEmpty(pageLoad)) { - hideOptions(pageLoad); - } - } - function hideAllViews(context) { - const { - prefetch = {} - } = context; - const { - views = [] - } = prefetch; - if (isEmpty(views)) { - return; - } - const actions = flatten(map(extractActions, views)); - hideAllViewsActions(actions); - } - function hideViewOptions(view) { - const actions = extractActions(view); - hideActions(actions); - removeAllViewsHidingStyle(); - } - function renderPageLoad(pageLoad) { - const postRenderingFunc = arr => postExecuteRendering(PAGE_LOAD, pageLoad, arr); - return renderExecuteItem(pageLoad, postRenderingFunc, executePageLoadMetrics); - } - function renderMboxes(mboxes) { - return all(map(renderMbox, mboxes)); - } - function renderPrefetchMboxes(mboxes) { - return all(map(renderPrefetchMbox, mboxes)); - } - function renderPrefetchMetrics(prefetch) { - const metrics = [executePrefetchMetrics(prefetch)]; - return all(metrics).then(postExecuteRendering); - } - function renderView(view) { - const { - page - } = view; - return renderPrefetchItem(VIEW, view, page, executeViewMetrics); - } - - function E() { - } - E.prototype = { - on: function (name, callback, ctx) { - var e = this.e || (this.e = {}); - (e[name] || (e[name] = [])).push({ - fn: callback, - ctx: ctx - }); - return this; - }, - once: function (name, callback, ctx) { - var self = this; - function listener() { - self.off(name, listener); - callback.apply(ctx, arguments); - } - listener._ = callback; - return this.on(name, listener, ctx); - }, - emit: function (name) { - var data = [].slice.call(arguments, 1); - var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); - var i = 0; - var len = evtArr.length; - for (i; i < len; i++) { - evtArr[i].fn.apply(evtArr[i].ctx, data); - } - return this; - }, - off: function (name, callback) { - var e = this.e || (this.e = {}); - var evts = e[name]; - var liveEvents = []; - if (evts && callback) { - for (var i = 0, len = evts.length; i < len; i++) { - if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]); - } - } - liveEvents.length ? e[name] = liveEvents : delete e[name]; - return this; - } - }; - var tinyEmitter = E; - var TinyEmitter = E; - tinyEmitter.TinyEmitter = TinyEmitter; - - function create$1() { - return new tinyEmitter(); - } - function publishOn(eventBus, name, args) { - eventBus.emit(name, args); - } - function subscribeTo(eventBus, name, func) { - eventBus.on(name, func); - } - - const EVENT_BUS = create$1(); - function publish(name, args) { - publishOn(EVENT_BUS, name, args); - } - function subscribe(name, func) { - subscribeTo(EVENT_BUS, name, func); - } - - function redirect$1(option) { - return { - type: REDIRECT, - content: option.url - }; - } - function setContent(action) { - const result = {}; - result.type = SET_HTML; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function setText$3(action) { - const result = {}; - result.type = SET_TEXT; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function appendContent(action) { - const result = {}; - result.type = APPEND_HTML; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function prependContent(action) { - const result = {}; - result.type = PREPEND_HTML; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function replaceContent(action) { - const result = {}; - result.type = REPLACE_HTML; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function insertBefore$2(action) { - const result = {}; - result.type = INSERT_BEFORE; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function insertAfter$2(action) { - const result = {}; - result.type = INSERT_AFTER; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function customCode$2(action) { - const result = {}; - result.type = CUSTOM_CODE; - result.content = action.content; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function setAttribute$2(action) { - const result = {}; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - if (action.attribute === SRC) { - result.type = SET_IMAGE_SOURCE; - result.content = action.value; - return result; - } - result.type = SET_ATTRIBUTE; - const content = {}; - content[action.attribute] = action.value; - result.content = content; - return result; - } - function setStyle$2(action) { - const { - style = {} - } = action; - const result = {}; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - if (!isNil(style.left) && !isNil(style.top)) { - result.type = MOVE; - result.content = style; - return result; - } - if (!isNil(style.width) && !isNil(style.height)) { - result.type = RESIZE; - result.content = style; - return result; - } - result.type = SET_STYLE; - result.content = style; - return result; - } - function remove$3(action) { - const result = {}; - result.type = REMOVE; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - return result; - } - function rearrange$2(action) { - const content = {}; - content.from = action.from; - content.to = action.to; - const result = {}; - result.type = REARRANGE; - result.selector = action.selector; - result.cssSelector = action.cssSelector; - result.content = content; - return result; - } - function hasSelectors(action) { - return isNotBlank(action.selector) && isNotBlank(action.cssSelector); - } - function createPageLoad(items) { - const result = {}; - if (isEmpty(items)) { - return result; - } - const options = []; - const metrics = []; - const actions = []; - forEach(item => { - const type = item.action; - switch (type) { - case SET_CONTENT: - if (hasSelectors(item)) { - actions.push(setContent(item)); - } else { - options.push({ - type: HTML, - content: item.content - }); - } - break; - case SET_JSON: - if (!isEmpty(item.content)) { - forEach(e => options.push({ - type: JSON$1, - content: e - }), item.content); - } - break; - case SET_TEXT: - actions.push(setText$3(item)); - break; - case APPEND_CONTENT: - actions.push(appendContent(item)); - break; - case PREPEND_CONTENT: - actions.push(prependContent(item)); - break; - case REPLACE_CONTENT: - actions.push(replaceContent(item)); - break; - case INSERT_BEFORE: - actions.push(insertBefore$2(item)); - break; - case INSERT_AFTER: - actions.push(insertAfter$2(item)); - break; - case CUSTOM_CODE: - actions.push(customCode$2(item)); - break; - case SET_ATTRIBUTE: - actions.push(setAttribute$2(item)); - break; - case SET_STYLE: - actions.push(setStyle$2(item)); - break; - case REMOVE: - actions.push(remove$3(item)); - break; - case REARRANGE: - actions.push(rearrange$2(item)); - break; - case REDIRECT: - options.push(redirect$1(item)); - break; - case TRACK_CLICK: - metrics.push({ - type: CLICK, - selector: item.selector, - eventToken: item.clickTrackId - }); - break; - } - }, items); - const pageLoad = {}; - const hasActions = !isEmpty(actions); - if (hasActions) { - options.push({ - type: ACTIONS, - content: actions - }); - } - const hasOptions = !isEmpty(options); - if (hasOptions) { - pageLoad.options = options; - } - const hasMetrics = !isEmpty(metrics); - if (hasMetrics) { - pageLoad.metrics = metrics; - } - if (isEmpty(pageLoad)) { - return result; - } - const execute = {}; - execute.pageLoad = pageLoad; - result.execute = execute; - return result; - } - function createMboxes(name, items) { - const result = {}; - if (isEmpty(items)) { - return result; - } - const options = []; - const metrics = []; - forEach(item => { - const type = item.action; - switch (type) { - case SET_CONTENT: - options.push({ - type: HTML, - content: item.content - }); - break; - case SET_JSON: - if (!isEmpty(item.content)) { - forEach(e => options.push({ - type: JSON$1, - content: e - }), item.content); - } - break; - case REDIRECT: - options.push(redirect$1(item)); - break; - case SIGNAL_CLICK: - metrics.push({ - type: CLICK, - eventToken: item.clickTrackId - }); - break; - } - }, items); - const mbox = { - name - }; - const hasOptions = !isEmpty(options); - if (hasOptions) { - mbox.options = options; - } - const hasMetrics = !isEmpty(metrics); - if (hasMetrics) { - mbox.metrics = metrics; - } - if (isEmpty(mbox)) { - return result; - } - const execute = {}; - const mboxes = [mbox]; - execute.mboxes = mboxes; - result.execute = execute; - return result; - } - function convertToContext(mbox, items, pageLoadEnabled) { - if (pageLoadEnabled) { - return createPageLoad(items); - } - return createMboxes(mbox, items); - } - - const PAGE_LOAD_RENDERING_FAILED = "Page load rendering failed"; - const MBOXES_RENDERING_FAILED = "Mboxes rendering failed"; - const VIEW_RENDERING_FAILED = "View rendering failed"; - const PREFETCH_RENDERING_FAILED = "Prefetch rendering failed"; - const hasErrors = items => !isEmpty(filter(isError, items)); - function getPageLoadData(pageLoad) { - const { - status, - data - } = pageLoad; - const result = { - status, - pageLoad: true - }; - if (!isNil(data)) { - result.data = data; - } - return result; - } - function getMboxData(item) { - const { - status, - mbox, - data - } = item; - const { - name - } = mbox; - const result = { - status, - mbox: name - }; - if (!isNil(data)) { - result.data = data; - } - return result; - } - function getViewData(item) { - const { - status, - view, - data - } = item; - const { - name - } = view; - const result = { - status, - view: name - }; - if (!isNil(data)) { - result.data = data; - } - return result; - } - function getPrefetchMetricsData(prefetchMetrics) { - const { - status, - data - } = prefetchMetrics; - const result = { - status, - prefetchMetrics: true - }; - if (!isNil(data)) { - result.data = data; - } - return result; - } - function handlePageLoad(pageLoad) { - if (isNil(pageLoad)) { - return [null]; - } - const result = map(getPageLoadData, [pageLoad]); - if (hasErrors(result)) { - logWarn(PAGE_LOAD_RENDERING_FAILED, pageLoad); - } - return result; - } - function handleMboxes(mboxes) { - if (isNil(mboxes)) { - return [null]; - } - const result = map(getMboxData, mboxes); - if (hasErrors(result)) { - logWarn(MBOXES_RENDERING_FAILED, mboxes); - } - return result; - } - function handlePrefetchMboxes(mboxes, func = sendMboxesRenderedNotifications) { - if (isNil(mboxes)) { - return [null]; - } - const result = map(getMboxData, mboxes); - if (hasErrors(result)) { - logWarn(MBOXES_RENDERING_FAILED, mboxes); - } - func(mboxes); - return result; - } - function handleView(item, func = sendViewRenderedNotifications) { - if (isNil(item)) { - return [null]; - } - const result = map(getViewData, [item]); - if (hasErrors(result)) { - logWarn(VIEW_RENDERING_FAILED, item); - } - const { - view - } = item; - if (!view.page) { - return result; - } - func(item); - return result; - } - function handlePrefetchMetrics(prefetchMetrics) { - if (isNil(prefetchMetrics)) { - return [null]; - } - const result = map(getPrefetchMetricsData, [prefetchMetrics]); - if (hasErrors(result)) { - logWarn(PREFETCH_RENDERING_FAILED, prefetchMetrics); - } - return result; - } - function handleRenderingSuccess$1(values) { - const results = flatten([handlePageLoad(values[0]), handleMboxes(values[1]), handlePrefetchMboxes(values[2]), handlePrefetchMetrics(values[3])]); - const nonNull = filter(notNil, results); - const errors = filter(isError, nonNull); - if (!isEmpty(errors)) { - return reject$1(errors); - } - return resolve$1(nonNull); - } - function handleRenderingError$1(err) { - return reject$1(err); - } - - function processOptions$2(selector, item) { - if (isEmpty(item)) { - return; - } - const { - options - } = item; - if (isEmpty(options)) { - return; - } - forEach(option => { - if (option.type !== HTML) { - return; - } - const type = SET_HTML; - const { - content - } = option; - option.type = ACTIONS; - option.content = [{ - type, - selector, - content - }]; - }, options); - } - function processMetrics$1(selector, item) { - const { - metrics - } = item; - if (isEmpty(metrics)) { - return; - } - const { - name - } = item; - forEach(metric => { - metric.name = name; - metric.selector = metric.selector || selector; - }, metrics); - } - function createRenderingContext(selector, context) { - const result = reactorObjectAssign({}, context); - const { - execute = {}, - prefetch = {} - } = result; - const { - pageLoad = {}, - mboxes = [] - } = execute; - const { - mboxes: prefetchMboxes = [] - } = prefetch; - processOptions$2(selector, pageLoad); - forEach(elem => processOptions$2(selector, elem), mboxes); - forEach(elem => processMetrics$1(selector, elem), mboxes); - forEach(elem => processOptions$2(selector, elem), prefetchMboxes); - forEach(elem => processMetrics$1(selector, elem), prefetchMboxes); - return result; - } - function persistViewsIfPresent(context) { - const { - prefetch = {} - } = context; - const { - views = [] - } = prefetch; - if (isEmpty(views)) { - return; - } - persistViews(views); - } - function renderContext(context) { - const promises = []; - const { - execute = {} - } = context; - const { - pageLoad = {}, - mboxes = [] - } = execute; - if (!isEmpty(pageLoad)) { - promises.push(renderPageLoad(pageLoad)); - } else { - promises.push(resolve$1(null)); - } - if (!isEmpty(mboxes)) { - promises.push(renderMboxes(mboxes)); - } else { - promises.push(resolve$1(null)); - } - const { - prefetch = {} - } = context; - const { - mboxes: prefetchMboxes = [], - metrics = [] - } = prefetch; - if (!isEmpty(prefetchMboxes)) { - promises.push(renderPrefetchMboxes(prefetchMboxes)); - } else { - promises.push(resolve$1(null)); - } - if (isArray(metrics) && !isEmpty(metrics)) { - promises.push(renderPrefetchMetrics(prefetch)); - } else { - promises.push(resolve$1(null)); - } - removeHidingSnippetStyle(); - return all(promises).then(handleRenderingSuccess$1)['catch'](handleRenderingError$1); - } - function executeRedirect(win, url) { - delay(() => win.location.replace(url)); - } - function retrieveSelector(selector) { - if (isNotBlank(selector)) { - return selector; - } - if (isElement(selector)) { - return selector; - } - return HEAD_TAG; - } - function showElement(selector) { - addClass(MARKER_CSS_CLASS, selector); - } - function executeApplyOffer(options) { - const { - mbox, - selector, - offer: actions - } = options; - const config = getConfig(); - const pageLoadEnabled = mbox === config[GLOBAL_MBOX_NAME]; - if (isEmpty(actions)) { - logDebug(NO_ACTIONS); - showElement(selector); - removeHidingSnippetStyle(); - notifyRenderingNoOffers({ - mbox - }); - return; - } - const context = convertToContext(mbox, actions, pageLoadEnabled); - const renderingContext = createRenderingContext(selector, context); - const redirect = getRedirect(renderingContext); - if (!isEmpty(redirect)) { - const { - url - } = redirect; - logDebug(REDIRECT_ACTION, redirect); - notifyRenderingRedirect({ - url - }); - executeRedirect(window, url); - return; - } - notifyRenderingStart({ - mbox - }); - hidePageLoadOptions(renderingContext); - renderContext(renderingContext).then(execution => { - if (isEmpty(execution)) { - return; - } - notifyRenderingSucceeded({ - mbox, - execution - }); - })['catch'](error => notifyRenderingFailed({ - error - })); - } - function isEmptyResponse(response = {}) { - const { - prefetch = {} - } = response; - const { - execute = {} - } = response; - const { - pageLoad: executePageLoad = {} - } = execute; - const { - mboxes: executeMboxes = [] - } = execute; - const { - pageLoad: prefetchPageLoad = {} - } = prefetch; - const { - views = [] - } = prefetch; - const { - mboxes: prefetchMboxes = [] - } = prefetch; - return isEmpty(executePageLoad) && isEmpty(executeMboxes) && isEmpty(prefetchPageLoad) && isEmpty(views) && isEmpty(prefetchMboxes); - } - function executeApplyOffers(options, skipPrehiding = false) { - const { - selector, - response - } = options; - if (isEmptyResponse(response)) { - logDebug(NO_ACTIONS); - showElement(selector); - removeHidingSnippetStyle(); - notifyRenderingNoOffers({}); - publish(NO_OFFERS_EVENT); - return resolve$1(); - } - const renderingContext = createRenderingContext(selector, response); - const redirect = getRedirect(renderingContext); - if (!isEmpty(redirect)) { - const { - url - } = redirect; - logDebug(REDIRECT_ACTION, redirect); - notifyRenderingRedirect({ - url - }); - publish(REDIRECT_OFFER_EVENT); - executeRedirect(window, url); - return resolve$1(); - } - notifyRenderingStart({}); - persistViewsIfPresent(renderingContext); - publish(CACHE_UPDATED_EVENT); - hidePageLoadOptions(renderingContext, skipPrehiding); - return renderContext(renderingContext).then(execution => { - if (isEmpty(execution)) { - return; + function arrayUnique(array) { + var a = []; + for (var i = 0, l = array.length; i < l; i++) { + if (a.indexOf(array[i]) === -1) { + a.push(array[i]); + } + } + return a; } - notifyRenderingSucceeded({ - execution - }); - })['catch'](error => notifyRenderingFailed({ - error - })); - } + var jsonLogic = {}; + var operations = { + "==": function (a, b) { + return a == b; + }, + "===": function (a, b) { + return a === b; + }, + "!=": function (a, b) { + return a != b; + }, + "!==": function (a, b) { + return a !== b; + }, + ">": function (a, b) { + return a > b; + }, + ">=": function (a, b) { + return a >= b; + }, + "<": function (a, b, c) { + return c === undefined ? a < b : a < b && b < c; + }, + "<=": function (a, b, c) { + return c === undefined ? a <= b : a <= b && b <= c; + }, + "!!": function (a) { + return jsonLogic.truthy(a); + }, + "!": function (a) { + return !jsonLogic.truthy(a); + }, + "%": function (a, b) { + return a % b; + }, + "log": function (a) { + console.log(a); + return a; + }, + "in": function (a, b) { + if (!b || typeof b.indexOf === "undefined") return false; + return b.indexOf(a) !== -1; + }, + "cat": function () { + return Array.prototype.join.call(arguments, ""); + }, + "substr": function (source, start, end) { + if (end < 0) { + var temp = String(source).substr(start); + return temp.substr(0, temp.length + end); + } + return String(source).substr(start, end); + }, + "+": function () { + return Array.prototype.reduce.call(arguments, function (a, b) { + return parseFloat(a, 10) + parseFloat(b, 10); + }, 0); + }, + "*": function () { + return Array.prototype.reduce.call(arguments, function (a, b) { + return parseFloat(a, 10) * parseFloat(b, 10); + }); + }, + "-": function (a, b) { + if (b === undefined) { + return -a; + } else { + return a - b; + } + }, + "/": function (a, b) { + return a / b; + }, + "min": function () { + return Math.min.apply(this, arguments); + }, + "max": function () { + return Math.max.apply(this, arguments); + }, + "merge": function () { + return Array.prototype.reduce.call(arguments, function (a, b) { + return a.concat(b); + }, []); + }, + "var": function (a, b) { + var not_found = b === undefined ? null : b; + var data = this; + if (typeof a === "undefined" || a === "" || a === null) { + return data; + } + var sub_props = String(a).split("."); + for (var i = 0; i < sub_props.length; i++) { + if (data === null || data === undefined) { + return not_found; + } + data = data[sub_props[i]]; + if (data === undefined) { + return not_found; + } + } + return data; + }, + "missing": function () { + var missing = []; + var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = jsonLogic.apply({ + "var": key + }, this); + if (value === null || value === "") { + missing.push(key); + } + } + return missing; + }, + "missing_some": function (need_count, options) { + var are_missing = jsonLogic.apply({ + "missing": options + }, this); + if (options.length - are_missing.length >= need_count) { + return []; + } else { + return are_missing; + } + } + }; + jsonLogic.is_logic = function (logic) { + return typeof logic === "object" && + logic !== null && + !Array.isArray(logic) && + Object.keys(logic).length === 1 + ; + }; + jsonLogic.truthy = function (value) { + if (Array.isArray(value) && value.length === 0) { + return false; + } + return !!value; + }; + jsonLogic.get_operator = function (logic) { + return Object.keys(logic)[0]; + }; + jsonLogic.get_values = function (logic) { + return logic[jsonLogic.get_operator(logic)]; + }; + jsonLogic.apply = function (logic, data) { + if (Array.isArray(logic)) { + return logic.map(function (l) { + return jsonLogic.apply(l, data); + }); + } + if (!jsonLogic.is_logic(logic)) { + return logic; + } + var op = jsonLogic.get_operator(logic); + var values = logic[op]; + var i; + var current; + var scopedLogic; + var scopedData; + var initial; + if (!Array.isArray(values)) { + values = [values]; + } + if (op === "if" || op == "?:") { + for (i = 0; i < values.length - 1; i += 2) { + if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) { + return jsonLogic.apply(values[i + 1], data); + } + } + if (values.length === i + 1) { + return jsonLogic.apply(values[i], data); + } + return null; + } else if (op === "and") { + for (i = 0; i < values.length; i += 1) { + current = jsonLogic.apply(values[i], data); + if (!jsonLogic.truthy(current)) { + return current; + } + } + return current; + } else if (op === "or") { + for (i = 0; i < values.length; i += 1) { + current = jsonLogic.apply(values[i], data); + if (jsonLogic.truthy(current)) { + return current; + } + } + return current; + } else if (op === "filter") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + if (!Array.isArray(scopedData)) { + return []; + } + return scopedData.filter(function (datum) { + return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum)); + }); + } else if (op === "map") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + if (!Array.isArray(scopedData)) { + return []; + } + return scopedData.map(function (datum) { + return jsonLogic.apply(scopedLogic, datum); + }); + } else if (op === "reduce") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + initial = typeof values[2] !== "undefined" ? values[2] : null; + if (!Array.isArray(scopedData)) { + return initial; + } + return scopedData.reduce(function (accumulator, current) { + return jsonLogic.apply(scopedLogic, { + current: current, + accumulator: accumulator + }); + }, initial); + } else if (op === "all") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + if (!Array.isArray(scopedData) || !scopedData.length) { + return false; + } + for (i = 0; i < scopedData.length; i += 1) { + if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) { + return false; + } + } + return true; + } else if (op === "none") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + if (!Array.isArray(scopedData) || !scopedData.length) { + return true; + } + for (i = 0; i < scopedData.length; i += 1) { + if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) { + return false; + } + } + return true; + } else if (op === "some") { + scopedData = jsonLogic.apply(values[0], data); + scopedLogic = values[1]; + if (!Array.isArray(scopedData) || !scopedData.length) { + return false; + } + for (i = 0; i < scopedData.length; i += 1) { + if (jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) { + return true; + } + } + return false; + } + values = values.map(function (val) { + return jsonLogic.apply(val, data); + }); + if (operations.hasOwnProperty(op) && typeof operations[op] === "function") { + return operations[op].apply(data, values); + } else if (op.indexOf(".") > 0) { + var sub_ops = String(op).split("."); + var operation = operations; + for (i = 0; i < sub_ops.length; i++) { + if (!operation.hasOwnProperty(sub_ops[i])) { + throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")"); + } + operation = operation[sub_ops[i]]; + } + return operation.apply(data, values); + } + throw new Error("Unrecognized operation " + op); + }; + jsonLogic.uses_data = function (logic) { + var collection = []; + if (jsonLogic.is_logic(logic)) { + var op = jsonLogic.get_operator(logic); + var values = logic[op]; + if (!Array.isArray(values)) { + values = [values]; + } + if (op === "var") { + collection.push(values[0]); + } else { + values.forEach(function (val) { + collection.push.apply(collection, jsonLogic.uses_data(val)); + }); + } + } + return arrayUnique(collection); + }; + jsonLogic.add_operation = function (name, code) { + operations[name] = code; + }; + jsonLogic.rm_operation = function (name) { + delete operations[name]; + }; + jsonLogic.rule_like = function (rule, pattern) { + if (pattern === rule) { + return true; + } + if (pattern === "@") { + return true; + } + if (pattern === "number") { + return typeof rule === "number"; + } + if (pattern === "string") { + return typeof rule === "string"; + } + if (pattern === "array") { + return Array.isArray(rule) && !jsonLogic.is_logic(rule); + } + if (jsonLogic.is_logic(pattern)) { + if (jsonLogic.is_logic(rule)) { + var pattern_op = jsonLogic.get_operator(pattern); + var rule_op = jsonLogic.get_operator(rule); + if (pattern_op === "@" || pattern_op === rule_op) { + return jsonLogic.rule_like(jsonLogic.get_values(rule, false), jsonLogic.get_values(pattern, false)); + } + } + return false; + } + if (Array.isArray(pattern)) { + if (Array.isArray(rule)) { + if (pattern.length !== rule.length) { + return false; + } + for (var i = 0; i < pattern.length; i += 1) { + if (!jsonLogic.rule_like(rule[i], pattern[i])) { + return false; + } + } + return true; + } else { + return false; + } + } + return false; + }; + return jsonLogic; + }); + })(logic); + var jsonLogic = logic.exports; - function hasServerState(config) { - const serverState = config[SERVER_STATE]; - if (isEmpty(serverState)) { - return false; - } - const { - request, - response - } = serverState; - if (isEmpty(request)) { - return false; - } - if (isEmpty(response)) { - return false; + const TOTAL_BUCKETS = 10000; + const MAX_PERCENTAGE = 100; + function validTntId() { + let tntId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + if (isString(tntId) && !isEmpty(tntId)) { + const [id, locationHint] = tntId.split("."); + return id; } - return true; - } - function getServerState(config) { - return config[SERVER_STATE]; - } - - const Messages = { - ERROR_MAX_RETRY: (numRetries, errString) => "Unable to retrieve artifact after " + numRetries + " retries: " + errString, - ARTIFACT_NOT_AVAILABLE: "The decisioning artifact is not available", - ARTIFACT_VERSION_UNSUPPORTED: (artifactVersion, supportedMajorVersion) => "The decisioning artifact version (" + artifactVersion + ") is not supported. This library is compatible with this major version: " + supportedMajorVersion, - ARTIFACT_FETCH_ERROR: reason => "Failed to retrieve artifact: " + reason, - ARTIFACT_INVALID: "Invalid Artifact", - INVALID_ENVIRONMENT: (expectedEnvironment, defaultEnvironment) => "'" + expectedEnvironment + "' is not a valid target environment, defaulting to '" + defaultEnvironment + "'.", - NOT_APPLICABLE: "Not Applicable", - ARTIFACT_OBFUSCATION_ERROR: "Unable to read artifact JSON", - UNKNOWN: "unknown" - }; - - const DEFAULT_POLLING_INTERVAL = 300000; - const MINIMUM_POLLING_INTERVAL = 300000; - const NUM_FETCH_RETRIES = 10; - const SUPPORTED_ARTIFACT_MAJOR_VERSION = 1; - const SUPPORTED_ARTIFACT_OBFUSCATION_VERSION = 1; - const REGEX_ARTIFACT_FILENAME_BINARY = /.+\.bin$/i; - const ARTIFACT_FORMAT_BINARY = "bin"; - const ARTIFACT_FORMAT_JSON = "json"; - const ARTIFACT_FORMAT_DEFAULT = ARTIFACT_FORMAT_JSON; - const ARTIFACT_FORMATS = [ARTIFACT_FORMAT_BINARY, ARTIFACT_FORMAT_JSON]; - const ARTIFACT_FILENAME = {}; - ARTIFACT_FILENAME[ARTIFACT_FORMAT_BINARY] = "rules.bin"; - ARTIFACT_FILENAME[ARTIFACT_FORMAT_JSON] = "rules.json"; - const LOG_PREFIX$1 = "LD"; - const CDN_BASE_PROD = "assets.adobetarget.com"; - const CDN_BASE_STAGE = "assets.staging.adobetarget.com"; - const CDN_BASE_DEV = "assets.staging.adobetarget.com"; - const HTTP_HEADER_FORWARDED_FOR = "x-forwarded-for"; - const HTTP_HEADER_GEO_LATITUDE = "x-geo-latitude"; - const HTTP_HEADER_GEO_LONGITUDE = "x-geo-longitude"; - const HTTP_HEADER_GEO_COUNTRY = "x-geo-country-code"; - const HTTP_HEADER_GEO_REGION = "x-geo-region-code"; - const HTTP_HEADER_GEO_CITY = "x-geo-city"; - const CDN_BASE = {}; - CDN_BASE[ENVIRONMENT_PROD] = CDN_BASE_PROD; - CDN_BASE[ENVIRONMENT_STAGE] = CDN_BASE_STAGE; - CDN_BASE[ENVIRONMENT_DEV] = CDN_BASE_DEV; - const CAMPAIGN_BUCKET_SALT = "0"; - const AUDIENCE_IDS = "audience.ids"; - const ACTIVITY_DECISIONING_METHOD = "activity.decisioningMethod"; - const ACTIVITY_ID = "activity.id"; - const ACTIVITY_NAME = "activity.name"; - const ACTIVITY_TYPE = "activity.type"; - const EXPERIENCE_ID = "experience.id"; - const EXPERIENCE_NAME = "experience.name"; - const LOCATION_ID = "location.id"; - const LOCATION_NAME = "location.name"; - const LOCATION_TYPE = "location.type"; - const OFFER_ID = "offer.id"; - const OFFER_NAME = "offer.name"; - const OPTION_ID = "option.id"; - const OPTION_NAME = "option.name"; - const GEO_CITY = "geo.city"; - const GEO_COUNTRY = "geo.country"; - const GEO_STATE = "geo.state"; - const GEO_LATITUDE = "geo.latitude"; - const GEO_LONGITUDE = "geo.longitude"; - - function getRuleKey(rule) { - return rule.ruleKey; + return undefined; } - function parseURL(url) { - if (!isString(url)) { - url = ""; - } - const parsed = parseUri(url) || {}; - const { - host = "", - path = "", - query = "", - anchor = "" - } = parsed; - const result = { - url, - path, - query, - fragment: anchor - }; - const domainParts = host.split("."); - switch (domainParts.length) { - case 1: - result.subdomain = ""; - result.domain = host; - result.topLevelDomain = ""; - break; - case 2: - result.subdomain = ""; - result.domain = host; - result.topLevelDomain = domainParts[1]; - break; - case 3: - result.subdomain = domainParts[0] === "www" ? "" : domainParts[0]; - result.domain = host; - result.topLevelDomain = domainParts[2]; - break; - case 4: - result.subdomain = domainParts[0] === "www" ? "" : domainParts[0]; - result.domain = host; - result.topLevelDomain = domainParts[2] + "." + domainParts[3]; - break; + function getOrCreateVisitorId(visitorId) { + if (visitorId) { + return visitorId.marketingCloudVisitorId || validTntId(visitorId.tntId) || visitorId.thirdPartyId || uuid() + ; } - return result; + return uuid(); } - function hasRemoteDependency(artifact, request) { - if (isUndefined(artifact)) { - throw new Error(Messages.ARTIFACT_NOT_AVAILABLE); - } - const requestedMboxes = Array.from(getMboxNames(request)); - const requestedViews = Array.from(getViewNames(request)); - const { - remoteMboxes = [], - localMboxes = [], - remoteViews = [], - localViews = [] - } = artifact; - const mboxesThatRequireRemote = new Set([...remoteMboxes.filter(mboxName => includes(mboxName, requestedMboxes)), ...requestedMboxes.filter(mboxName => !includes(mboxName, localMboxes))]); - const viewsThatRequireRemote = hasRequestedViews(request) && requestedViews.length === 0 ? new Set(remoteViews) : new Set([...remoteViews.filter(viewName => includes(viewName, requestedViews)), ...requestedViews.filter(viewName => !includes(viewName, localViews))]); - return { - remoteNeeded: mboxesThatRequireRemote.size > 0 || viewsThatRequireRemote.size > 0, - remoteMboxes: Array.from(mboxesThatRequireRemote), - remoteViews: Array.from(viewsThatRequireRemote) - }; + function calculateAllocation(deviceId) { + const signedNumericHashValue = hashUnencodedChars(deviceId); + const hashFixedBucket = Math.abs(signedNumericHashValue) % TOTAL_BUCKETS; + const allocationValue = hashFixedBucket / TOTAL_BUCKETS * MAX_PERCENTAGE; + return Math.round(allocationValue * 100) / 100; } - function matchMajorVersion(semanticVersion, majorVersion) { - const [major, minor, patch] = semanticVersion.split(".").map(value => parseInt(value, 10)); - return majorVersion === major; + const calculateAllocationMemoized = memoize(calculateAllocation); + function computeAllocation(clientId, activityId, visitorId) { + let salt = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : CAMPAIGN_BUCKET_SALT; + const deviceId = [clientId, activityId, isString(visitorId) && !isEmpty(visitorId) ? visitorId : getOrCreateVisitorId(visitorId), salt].join("."); + return calculateAllocationMemoized(deviceId); } - function cloneDeep(obj) { - if (isDefined(obj)) { - return JSON.parse(JSON.stringify(obj)); - } - return undefined; + + function ruleEvaluator(clientId, visitorId) { + const visitorIdString = getOrCreateVisitorId(visitorId); + return function processRule(rule, context, requestType, requestDetail, postProcessors, tracer) { + let consequence; + let { + page, + referring + } = context; + if (isDefined(requestDetail.address)) { + page = createPageContext(requestDetail.address) || page; + referring = createPageContext(requestDetail.address) || referring; + } + const ruleContext = _objectSpread2(_objectSpread2({}, context), {}, { + page, + referring, + mbox: createMboxContext(requestDetail), + allocation: computeAllocation(clientId, rule.meta[ACTIVITY_ID], visitorIdString) + }); + const ruleSatisfied = jsonLogic.apply(rule.condition, ruleContext); + tracer.traceRuleEvaluated(rule, requestDetail, requestType, ruleContext, ruleSatisfied); + if (ruleSatisfied) { + consequence = _objectSpread2(_objectSpread2({}, rule.consequence), {}, { + index: requestDetail.index + }); + postProcessors.forEach(postProcessFunc => { + consequence = postProcessFunc(rule, consequence, requestType, requestDetail, tracer); + }); + } + return cloneDeep(consequence); + }; } - function getValidEnvironment(environmentName, logger) { - const isValid = includes(environmentName, POSSIBLE_ENVIRONMENTS); - if (!isValid) { - getLogger(logger).debug(Messages.INVALID_ENVIRONMENT(environmentName, ENVIRONMENT_PROD)); + + function byPropertyToken(propertyToken) { + function filter(rule) { + const { + propertyTokens = [] + } = rule; + return isUndefined(propertyToken) ? propertyTokens.length === 0 : propertyTokens.length === 0 || includes(propertyToken, propertyTokens); } - return isValid ? environmentName : ENVIRONMENT_PROD; + return filter; } - function getTargetEnvironment(config) { + + const LOG_TAG$1 = LOG_PREFIX + ".DecisionProvider"; + const PARTIAL_CONTENT = 206; + const OK$1 = 200; + function DecisionProvider(config, targetOptions, context, artifact, logger, traceProvider) { const { - environment = ENVIRONMENT_PROD - } = config; - return getValidEnvironment(environment, config.logger); - } - function getCdnEnvironment(config) { + responseTokens, + rules + } = artifact; + const globalMboxName = artifact.globalMbox || DEFAULT_GLOBAL_MBOX; + const clientId = config.client; const { - cdnEnvironment = ENVIRONMENT_PROD - } = config; - return getValidEnvironment(cdnEnvironment, config.logger); - } - function getCdnBasePath(config) { - let { - cdnBasePath - } = config; - if (!isDefined(cdnBasePath)) { - const cdnEnvironment = getCdnEnvironment(config); - const env = includes(cdnEnvironment, POSSIBLE_ENVIRONMENTS) ? cdnEnvironment : ENVIRONMENT_PROD; - cdnBasePath = CDN_BASE[env]; - } - return "https://" + cdnBasePath; - } - function getArtifactFileName(artifactFormat = ARTIFACT_FORMAT_DEFAULT) { - artifactFormat = includes(artifactFormat, ARTIFACT_FORMATS) ? artifactFormat : ARTIFACT_FORMAT_DEFAULT; - return ARTIFACT_FILENAME[artifactFormat]; - } - function getGeoLookupPath(config) { - const cdnBasePath = getCdnBasePath(config); - return cdnBasePath + "/v" + SUPPORTED_ARTIFACT_MAJOR_VERSION + "/geo"; - } - function determineArtifactLocation(config, addPropertyToken = isBrowser()) { + request, + visitor + } = targetOptions; + const propertyToken = getPropertyToken$1(request.property); const { - client, - propertyToken, - artifactFormat, - artifactLocation + sendNotificationFunc, + telemetryEnabled = true } = config; - if (isString(artifactLocation)) { - return artifactLocation; - } - const targetEnvironment = getTargetEnvironment(config); - return [getCdnBasePath(config), client, targetEnvironment, "v" + SUPPORTED_ARTIFACT_MAJOR_VERSION, addPropertyToken ? propertyToken : undefined, getArtifactFileName(artifactFormat)].filter(value => isDefined(value)).join("/"); - } - function determineArtifactFormat(artifactLocation) { - return artifactLocation.match(REGEX_ARTIFACT_FILENAME_BINARY) != null ? ARTIFACT_FORMAT_BINARY : ARTIFACT_FORMAT_JSON; - } - function firstMatch(key, searchObjects = [], defaultValue = undefined) { - for (let i = 0; i < searchObjects.length; i += 1) { - const haystack = searchObjects[i]; - if (isObject(haystack) && isDefined(haystack[key])) { - return haystack[key]; + const visitorId = request.id; + const processRule = ruleEvaluator(clientId, visitorId); + const dependency = hasRemoteDependency$1(artifact, request); + const notificationProvider = NotificationProvider(request, visitor, logger, sendNotificationFunc, telemetryEnabled); + function getDecisions(mode, postProcessors) { + if (isUndefined(request[mode])) { + return undefined; + } + const requestTracer = RequestTracer(traceProvider, artifact); + function processViewRequest(requestDetails) { + let additionalPostProcessors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + requestTracer.traceRequest(mode, RequestType.VIEW, requestDetails, context); + const consequences = {}; + let viewRules = []; + if (Object.prototype.hasOwnProperty.call(requestDetails, "name") && isDefined(requestDetails.name)) { + viewRules = rules.views[requestDetails.name] || []; + } else { + viewRules = Object.keys(rules.views).reduce((result, key) => [...result, ...rules.views[key]], []); + } + viewRules = viewRules.filter(byPropertyToken(propertyToken)); + const matchedRuleKeys = new Set(); + for (const rule of viewRules) { + const ruleKey = getRuleKey(rule); + let consequence; + if (!matchedRuleKeys.has(ruleKey)) { + consequence = processRule(rule, context, RequestType.VIEW, requestDetails, [...postProcessors, ...additionalPostProcessors], requestTracer); + } + if (consequence) { + matchedRuleKeys.add(ruleKey); + if (!consequences[consequence.name]) { + consequences[consequence.name] = consequence; + } else { + consequences[consequence.name] = _objectSpread2(_objectSpread2({}, consequences[consequence.name]), {}, { + options: [...consequences[consequence.name].options, ...consequence.options], + metrics: [...consequences[consequence.name].metrics, ...consequence.metrics] + }); + } + } + } + return values(consequences); + } + function processMboxRequest(mboxRequest) { + let additionalPostProcessors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + const isGlobalMbox = mboxRequest.name === globalMboxName; + requestTracer.traceRequest(mode, RequestType.MBOX, mboxRequest, context); + const consequences = []; + const mboxRules = (rules.mboxes[mboxRequest.name] || []).filter(byPropertyToken(propertyToken)); + const matchedRuleKeys = new Set(); + for (const rule of mboxRules) { + const ruleKey = getRuleKey(rule); + let consequence; + if (!isGlobalMbox || isGlobalMbox && !matchedRuleKeys.has(ruleKey)) { + consequence = processRule(rule, context, RequestType.MBOX, mboxRequest, [...postProcessors, ...additionalPostProcessors], requestTracer); + } + if (consequence) { + consequences.push(consequence); + matchedRuleKeys.add(ruleKey); + if (!isGlobalMbox) { + break; + } + } + } + if (!isGlobalMbox && consequences.length === 0) { + consequences.push({ + name: mboxRequest.name, + index: mboxRequest.index, + trace: requestTracer.getTraceResult() + }); + } + return consequences; } + function processPageLoadRequest(requestDetails) { + let trace; + const consequences = processMboxRequest(_objectSpread2(_objectSpread2({}, requestDetails), {}, { + name: globalMboxName + }), [function preserveTrace(rule, mboxResponse) { + trace = mboxResponse.trace; + return mboxResponse; + }, removePageLoadAttributes]); + const options = flatten(consequences.map(consequence => consequence.options)); + const result = { + options, + trace + }; + const indexedMetrics = consequences.reduce((indexed, consequence) => { + if (consequence.metrics instanceof Array) { + consequence.metrics.forEach(metric => { + indexed[metric.eventToken] = metric; + }); + } + return indexed; + }, {}); + const metrics = values(indexedMetrics); + if (metrics.length > 0) { + result.metrics = metrics; + } + return result; + } + const response = {}; + if (request[mode].mboxes) { + response.mboxes = flatten(request[mode].mboxes.map(mboxRequest => processMboxRequest(mboxRequest))); + } + if (request[mode].views) { + response.views = flatten(request[mode].views.map(requestDetails => processViewRequest(requestDetails))); + } + if (request[mode].pageLoad) { + response.pageLoad = processPageLoadRequest(request[mode].pageLoad); + } + return response; } - return defaultValue; - } - - const EMPTY_CONTEXT = { - channel: ChannelType.Web - }; - function getLowerCaseAttributes(obj) { - const result = {}; - Object.keys(obj).forEach(key => { - result[key + "_lc"] = isString(obj[key]) ? obj[key].toLowerCase() : obj[key]; - }); - return result; - } - function createBrowserContext(context) { - const { - userAgent = "" - } = context; - const browser = browserFromUserAgent(userAgent); - const platform = operatingSystemFromUserAgent(userAgent); - return { - browserType: browser.name.toLowerCase(), - platform, - locale: "en", - browserVersion: browser.version - }; - } - function createUrlContext(url) { - if (!url || !isString(url)) { - url = ""; + function getExecuteDecisions(postProcessors) { + return getDecisions("execute", [function prepareNotification(rule, mboxResponse, requestType, requestDetail, tracer) { + notificationProvider.addNotification(mboxResponse, tracer.traceNotification(rule)); + return mboxResponse; + }, prepareExecuteResponse, ...postProcessors]); } - const urlAttributes = parseURL(url); - return _objectSpread2(_objectSpread2({}, urlAttributes), getLowerCaseAttributes(urlAttributes)); - } - function createPageContext(address) { - return createUrlContext(address ? address.url : ""); - } - function createReferringContext(address) { - return createUrlContext(address ? address.referringUrl : ""); - } - function createMboxContext(mboxRequest) { - if (!mboxRequest) { - return {}; + function getPrefetchDecisions(postProcessors) { + return getDecisions("prefetch", [preparePrefetchResponse, ...postProcessors]); } - const parameters = mboxRequest.parameters || {}; - return _objectSpread2(_objectSpread2({}, parameters), getLowerCaseAttributes(parameters)); + const addResponseTokens = createResponseTokensPostProcessor(context, responseTokens); + const commonPostProcessor = [addResponseTokens, replaceCampaignMacros, addTrace, cleanUp]; + const response = objectWithoutUndefinedValues({ + status: dependency.remoteNeeded ? PARTIAL_CONTENT : OK$1, + remoteMboxes: dependency.remoteMboxes, + remoteViews: dependency.remoteViews, + requestId: request.requestId, + id: _objectSpread2({}, request.id), + client: clientId, + edgeHost: undefined, + execute: getExecuteDecisions(commonPostProcessor), + prefetch: getPrefetchDecisions(commonPostProcessor) + }); + notificationProvider.sendNotifications(); + logger.debug("" + LOG_TAG$1, request, response); + return Promise.resolve(response); + } + + const GEO_MAPPINGS = [{ + headerName: HTTP_HEADER_FORWARDED_FOR, + parseValue: value => value, + valueKey: "ipAddress" + }, { + headerName: HTTP_HEADER_GEO_LATITUDE, + parseValue: value => parseFloat(value), + valueKey: "latitude" + }, { + headerName: HTTP_HEADER_GEO_LONGITUDE, + parseValue: value => parseFloat(value), + valueKey: "longitude" + }, { + headerName: HTTP_HEADER_GEO_COUNTRY, + parseValue: value => value, + valueKey: "countryCode" + }, { + headerName: HTTP_HEADER_GEO_REGION, + parseValue: value => value, + valueKey: "stateCode" + }, { + headerName: HTTP_HEADER_GEO_CITY, + parseValue: value => value, + valueKey: "city" + }]; + function mapGeoValues(valueFn) { + let initial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return GEO_MAPPINGS.reduce((result, mapping) => { + const value = valueFn.call(null, mapping.headerName); + if (value != null && isDefined(value)) { + result[mapping.valueKey] = mapping.parseValue(value); + } + return result; + }, initial); } - function createGeoContext(geoContext = {}) { - return { - country: geoContext.countryCode, - region: geoContext.stateCode, - city: geoContext.city, - latitude: geoContext.latitude, - longitude: geoContext.longitude - }; + function createGeoObjectFromHeaders(geoHeaders) { + return mapGeoValues(key => geoHeaders.get(key)); } - function createTimingContext() { - const now = new Date(); - const twoDigitString = value => value < 10 ? "0" + value : String(value); - const currentHours = twoDigitString(now.getUTCHours()); - const currentMinutes = twoDigitString(now.getUTCMinutes()); - const currentTime = "" + currentHours + currentMinutes; - const currentDay = now.getUTCDay(); - return { - current_timestamp: now.getTime(), - current_time: currentTime, - current_day: currentDay === 0 ? 7 : currentDay - }; + function createGeoObjectFromPayload() { + let geoPayload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return mapGeoValues(key => geoPayload[key]); } - function createDecisioningContext(deliveryRequest) { + function GeoProvider(config, artifact) { + const fetchApi = getFetchApi(config.fetchApi); const { - context = EMPTY_CONTEXT - } = deliveryRequest; - return _objectSpread2(_objectSpread2({}, createTimingContext()), {}, { - user: createBrowserContext(context), - page: createPageContext(context.address), - referring: createReferringContext(context.address), - geo: createGeoContext(context.geo || {}) - }); - } - - const LOG_TAG = LOG_PREFIX$1 + ".NotificationProvider"; - function NotificationProvider(request, visitor, logger, sendNotificationFunc = noop, telemetryEnabled = true) { + geoTargetingEnabled = false + } = artifact; const { - requestId - } = request; - const timestamp = now(); - const prevEventKeys = new Set(); - let notifications = []; - let telemetryEntries = []; - function addNotification(mbox, traceFn = noop) { - const displayTokens = []; - mbox.options.forEach(option => { - const { - eventToken - } = option; - const eventKey = mbox.name + "-" + eventToken; - if (isDefined(eventToken) && !prevEventKeys.has(eventKey)) { - displayTokens.push(eventToken); - prevEventKeys.add(eventKey); + eventEmitter = noop$1 + } = config; + function validGeoRequestContext() { + let geoRequestContext = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const validatedGeoRequestContext = _objectSpread2({}, geoRequestContext); + if (geoRequestContext.ipAddress === UNKNOWN_IP_ADDRESS || !isValidIpAddress(geoRequestContext.ipAddress)) { + delete validatedGeoRequestContext.ipAddress; + } + const geoLookupPath = getGeoLookupPath(config); + if (geoTargetingEnabled && (geoRequestContext.ipAddress === UNKNOWN_IP_ADDRESS || isValidIpAddress(geoRequestContext.ipAddress)) && isUndefined(geoRequestContext.latitude) && isUndefined(geoRequestContext.longitude) && isUndefined(geoRequestContext.countryCode) && isUndefined(geoRequestContext.stateCode) && isUndefined(geoRequestContext.city)) { + const headers = {}; + if (geoRequestContext.ipAddress !== UNKNOWN_IP_ADDRESS) { + headers[HTTP_HEADER_FORWARDED_FOR] = geoRequestContext.ipAddress; } - }); - if (displayTokens.length === 0) { - return; + return fetchApi(geoLookupPath, { + headers + }).then(geoResponse => geoResponse.json().then(geoPayload => createGeoObjectFromPayload(geoPayload))).then(fetchedGeoValues => { + reactorObjectAssign(validatedGeoRequestContext, fetchedGeoValues); + eventEmitter(GEO_LOCATION_UPDATED, { + geoContext: validatedGeoRequestContext + }); + return validatedGeoRequestContext; + }); } - const notification = { - id: uuid(), - impressionId: uuid(), - timestamp, - type: MetricType.Display, - mbox: { - name: mbox.name - }, - tokens: displayTokens + return Promise.resolve(validatedGeoRequestContext); + } + return validGeoRequestContext; + } + + const HEADER_BOUNDARY = 40; + function ObfuscationProvider(config) { + const { + organizationId + } = config; + const decoder = new TextDecoder("utf-8"); + function getHeader(buffer) { + const dataView = new DataView(buffer); + const text = decoder.decode(dataView); + const [prefix, version] = text.slice(0, 8).split(":"); + const key = text.slice(8, 41); + return { + prefix, + version: parseInt(version, 10), + key }; - if (isFunction(traceFn)) { - traceFn(notification); - } - notifications.push(notification); } - function addTelemetryEntry(entry) { - if (!telemetryEnabled) { - return; + function getArtifact(key, obfuscatedArtifactBuffer) { + let deobfuscatedArtifactJSON = {}; + const keyBuffer = new TextEncoder().encode([organizationId, key].join("")); + const keyView = new DataView(keyBuffer.buffer); + const keyLength = keyView.byteLength; + const obfuscatedArtifactView = new DataView(obfuscatedArtifactBuffer); + const artifactLength = obfuscatedArtifactView.byteLength; + const deobfuscatedArtifactView = new DataView(new ArrayBuffer(artifactLength)); + for (let i = 0; i < artifactLength; i += 1) { + deobfuscatedArtifactView.setInt8(i, obfuscatedArtifactView.getInt8(i) ^ keyView.getInt8(i % keyLength)); } - telemetryEntries.push(_objectSpread2({ - requestId, - timestamp, - features: { - decisioningMethod: DECISIONING_METHOD.ON_DEVICE - } - }, entry)); + const deobfuscatedArtifactString = decoder.decode(deobfuscatedArtifactView); + try { + deobfuscatedArtifactJSON = JSON.parse(deobfuscatedArtifactString); + } catch (err) { + throw new Error(Messages.ARTIFACT_OBFUSCATION_ERROR); + } + return deobfuscatedArtifactJSON; } - function sendNotifications() { - logger.debug(LOG_TAG + ".sendNotifications", notifications, telemetryEntries); - if (notifications.length > 0 || telemetryEntries.length > 0) { - const { - id, - context, - experienceCloud - } = request; - const notification = { - request: { - id, - context, - experienceCloud - }, - visitor - }; - if (notifications.length > 0) { - notification.request.notifications = notifications; - } - if (telemetryEntries.length > 0) { - notification.request.telemetry = { - entries: telemetryEntries - }; - } - setTimeout(() => sendNotificationFunc.call(null, notification), 0); - notifications = []; - telemetryEntries = []; + function deobfuscate(buffer) { + const header = getHeader(buffer.slice(0, HEADER_BOUNDARY)); + if (header.version !== SUPPORTED_ARTIFACT_OBFUSCATION_VERSION) { + throw new Error(Messages.ARTIFACT_INVALID); } + return getArtifact(header.key, buffer.slice(HEADER_BOUNDARY)); } return { - addNotification, - addTelemetryEntry, - sendNotifications + deobfuscate }; } - const byOrder = (a, b) => a.order - b.order; - function TraceProvider(config, targetOptions, artifactTrace) { - const clientCode = config.client; + const TIMING_ARTIFACT_DOWNLOADED_TOTAL = "artifactDownloaded_total"; + const TIMING_ARTIFACT_DOWNLOADED_FETCH = "artifactDownloaded_fetch"; + const TIMING_ARTIFACT_GET_INITIAL = "artifactGetInitial"; + const TIMING_ARTIFACT_READ_JSON = "artifactDownloaded_read_JSON"; + const TIMING_ARTIFACT_DEOBFUSCATE = "deobfuscate_total"; + + const LOG_TAG = LOG_PREFIX + ".ArtifactProvider"; + const NOT_MODIFIED = 304; + const OK = 200; + const ARTIFACT_DOWNLOAD = "ArtifactDownload"; + function ArtifactProvider(config, telemetryProvider) { + const logger = getLogger(config.logger); const { - sessionId, - request - } = targetOptions; - const showTraces = isDefined(request.trace); - const [tntId, profileLocation] = isDefined(request.id) && isString(request.id.tntId) ? request.id.tntId.split(".") : [undefined, undefined]; - const profile = { - visitorId: _objectSpread2(_objectSpread2({}, request.id), {}, { - tntId, - profileLocation - }) - }; - function wrap(traceResult) { - if (!showTraces) { + eventEmitter = noop$1 + } = config; + const obfuscationProvider = ObfuscationProvider(config); + function getPollingInterval() { + if ( + isNumber(config.pollingInterval) && config.pollingInterval === 0) { + return 0; + } + return Math.max(MINIMUM_POLLING_INTERVAL, isNumber(config.pollingInterval) ? config.pollingInterval : DEFAULT_POLLING_INTERVAL$1); + } + const pollingInterval = getPollingInterval(); + const fetchApi = getFetchApi(config.fetchApi); + let pollingHalted = false; + let pollingTimer; + let artifact; + const subscriptions = {}; + let subscriptionCount = 0; + let lastResponseEtag; + let lastResponseData; + const artifactLocation = determineArtifactLocation(config); + const artifactFormat = isString(config.artifactFormat) ? config.artifactFormat : determineArtifactFormat(artifactLocation); + const fetchWithRetry = getFetchWithRetry(fetchApi, NUM_FETCH_RETRIES, errorMessage => Messages.ERROR_MAX_RETRY(NUM_FETCH_RETRIES, errorMessage), error => eventEmitter(ARTIFACT_DOWNLOAD_FAILED, { + artifactLocation, + error + })); + function emitNewArtifact(artifactPayload) { + let geoContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + eventEmitter(ARTIFACT_DOWNLOAD_SUCCEEDED, { + artifactLocation, + artifactPayload + }); + eventEmitter(GEO_LOCATION_UPDATED, { + geoContext + }); + values(subscriptions).forEach(subscriptionFunc => subscriptionFunc(artifactPayload)); + } + function deobfuscate(res) { + if (artifactFormat === ARTIFACT_FORMAT_BINARY) { + perfTool.timeStart(TIMING_ARTIFACT_DEOBFUSCATE); + return res.arrayBuffer().then(buffer => obfuscationProvider.deobfuscate(buffer).then(deobfuscated => { + perfTool.timeEnd(TIMING_ARTIFACT_DEOBFUSCATE); + return deobfuscated; + })); + } + perfTool.timeStart(TIMING_ARTIFACT_READ_JSON); + return res.json().then(data => { + perfTool.timeEnd(TIMING_ARTIFACT_READ_JSON); + return data; + }); + } + function fetchArtifact(artifactUrl) { + perfTool.timeStart(TIMING_ARTIFACT_DOWNLOADED_TOTAL); + const headers = {}; + logger.debug(LOG_TAG + " fetching artifact - " + artifactUrl); + if (lastResponseEtag && !isBrowser() && isNodeJS()) { + headers["If-None-Match"] = lastResponseEtag; + } + perfTool.timeStart(TIMING_ARTIFACT_DOWNLOADED_FETCH); + return fetchWithRetry(artifactUrl, { + headers, + cache: "default" + }).then(res => { + const executionTime = perfTool.timeEnd(TIMING_ARTIFACT_DOWNLOADED_FETCH); + perfTool.clearTiming(TIMING_ARTIFACT_DOWNLOADED_FETCH); + logger.debug(LOG_TAG + " artifact received - status=" + res.status); + const entry = { + execution: executionTime + }; + if (res.timings) { + entry.parsing = res.timings.parsingTime; + delete res.timings.parsingTime; + entry.request = res.timings; + } + telemetryProvider.addArtifactRequestEntry(ARTIFACT_DOWNLOAD, entry); + if (res.status === NOT_MODIFIED && lastResponseData) { + return lastResponseData; + } + if (res.ok && res.status === OK) { + return deobfuscate(res).then(responseData => { + const etag = res.headers.get("Etag"); + if (etag != null && isDefined(etag)) { + lastResponseData = responseData; + lastResponseEtag = etag; + } + emitNewArtifact(responseData, createGeoObjectFromHeaders(res.headers)); + perfTool.timeEnd(TIMING_ARTIFACT_DOWNLOADED_TOTAL); + return responseData; + }); + } return undefined; + })['catch'](err => { + const reason = err.message || err.toString(); + logger.error(Messages.ARTIFACT_FETCH_ERROR(reason)); + }); + } + function addSubscription(callbackFunc) { + subscriptionCount += 1; + subscriptions[subscriptionCount] = callbackFunc; + return subscriptionCount; + } + function removeSubscription(id) { + delete subscriptions[id]; + } + function scheduleNextUpdate() { + if (pollingInterval === 0 || pollingHalted) { + return; + } + pollingTimer = setTimeout(() => { + fetchArtifact(artifactLocation).then(newArtifact => { + artifact = newArtifact; + return newArtifact; + }); + scheduleNextUpdate(); + }, pollingInterval); + } + function stopAllPolling() { + if (isDefined(pollingTimer)) { + clearTimeout(pollingTimer); + pollingTimer = undefined; } + pollingHalted = true; + } + function resumePolling() { + pollingHalted = false; + scheduleNextUpdate(); + } + function getArtifact() { + return artifact; + } + function getInitialArtifact() { + perfTool.timeStart(TIMING_ARTIFACT_GET_INITIAL); + return isObject(config.artifactPayload) ? Promise.resolve(config.artifactPayload) : fetchArtifact(artifactLocation); + } + return getInitialArtifact().then(newArtifact => { + perfTool.timeEnd(TIMING_ARTIFACT_GET_INITIAL); + artifact = newArtifact; + const artifactTracer = ArtifactTracer(artifactLocation, config.artifactPayload, pollingInterval, pollingHalted, artifact); + addSubscription(value => artifactTracer.provideNewArtifact(value)); return { - clientCode, - artifact: artifactTrace, - profile, - request: _objectSpread2({ - sessionId - }, traceResult.request), - campaigns: traceResult.campaigns, - evaluatedCampaignTargets: traceResult.evaluatedCampaignTargets + getArtifact: () => getArtifact(), + subscribe: callbackFunc => addSubscription(callbackFunc), + unsubscribe: id => removeSubscription(id), + stopPolling: () => stopAllPolling(), + resumePolling: () => resumePolling(), + getTrace: () => artifactTracer.toJSON() }; + }).finally(() => { + scheduleNextUpdate(); + }); + } + + function getCustomerId(visitorId) { + if (!visitorId.customerIds || !(visitorId.customerIds instanceof Array)) { + return undefined; } - return { - wrap - }; + const customerIds = visitorId.customerIds.filter(customerId => customerId.authenticatedState === AuthenticatedState.Authenticated); + if (customerIds.length > 0) { + return customerIds[0].id; + } + return undefined; } - function RequestTracer(traceProvider, artifact) { - let request = {}; - const campaigns = {}; - let campaignOrder = 0; - const evaluatedCampaignTargets = {}; - let evaluatedCampaignTargetOrder = 0; - function traceRequest(mode, requestType, mboxRequest, context) { - request = { - pageURL: context.page.url, - host: context.page.domain - }; - request[requestType] = _objectSpread2(_objectSpread2({}, mboxRequest), {}, { - type: mode - }); + function validVisitorId(visitorId, targetLocationHint) { + const result = _objectSpread2({}, visitorId); + if (!result.tntId && !result.marketingCloudVisitorId && !getCustomerId(result) && !result.thirdPartyId) { + const locationHint = isString(targetLocationHint) && !isBlank(targetLocationHint) ? "." + targetLocationHint + "_0" : ""; + result.tntId = "" + uuid() + locationHint; } - function addCampaign(rule, ruleSatisfied) { - const { - meta - } = rule; - const activityId = meta[ACTIVITY_ID]; - if (ruleSatisfied && isUndefined(campaigns[activityId])) { - campaignOrder += 1; - campaigns[activityId] = { - id: activityId, - order: campaignOrder, - campaignType: meta[ACTIVITY_TYPE], - branchId: meta[EXPERIENCE_ID], - offers: isDefined(meta[OFFER_ID]) ? [meta[OFFER_ID]] : [], - environment: artifact.meta.environment - }; + return result; + } + function validDeliveryRequest(request, targetLocationHint, validGeoRequestContext) { + const { + context = {} + } = request; + return validGeoRequestContext(context.geo || {}).then(geo => _objectSpread2(_objectSpread2({}, request), {}, { + context: _objectSpread2(_objectSpread2({}, context), {}, { + geo + }), + id: validVisitorId(request.id, targetLocationHint), + requestId: request.requestId || uuid() + })); + } + + function TargetDecisioningEngine(config, telemetryProvider) { + const logger = getLogger(config.logger); + let artifactProvider; + let artifact; + function getOffers(targetOptions) { + let { + request + } = targetOptions; + if (isUndefined(artifact)) { + return Promise.reject(new Error(Messages.ARTIFACT_NOT_AVAILABLE)); } - } - function addEvaluatedCampaignTarget(rule, ruleContext, ruleSatisfied) { - const { - meta - } = rule; - const audienceIds = meta[AUDIENCE_IDS]; - const activityId = meta[ACTIVITY_ID]; - if (isUndefined(evaluatedCampaignTargets[activityId])) { - evaluatedCampaignTargetOrder += 1; - evaluatedCampaignTargets[activityId] = { - order: evaluatedCampaignTargetOrder, - context: ruleContext, - campaignId: activityId, - campaignType: meta[ACTIVITY_TYPE], - matchedSegmentIds: new Set(), - unmatchedSegmentIds: new Set(), - matchedRuleConditions: [], - unmatchedRuleConditions: [] - }; + if (!matchMajorVersion(artifact.version, SUPPORTED_ARTIFACT_MAJOR_VERSION)) { + return Promise.reject(new Error(Messages.ARTIFACT_VERSION_UNSUPPORTED(artifact.version, SUPPORTED_ARTIFACT_MAJOR_VERSION))); } - audienceIds.forEach(audienceId => { - evaluatedCampaignTargets[activityId][ruleSatisfied ? "matchedSegmentIds" : "unmatchedSegmentIds"].add(audienceId); + return validDeliveryRequest(request, targetOptions.targetLocationHint, GeoProvider(config, artifact)).then(validRequest => { + request = validRequest; + const options = _objectSpread2(_objectSpread2({}, targetOptions), {}, { + request + }); + const traceProvider = TraceProvider(config, options, artifactProvider.getTrace()); + return DecisionProvider(config, options, createDecisioningContext(request), artifact, logger, traceProvider); }); - evaluatedCampaignTargets[activityId][ruleSatisfied ? "matchedRuleConditions" : "unmatchedRuleConditions"].push(rule.condition); } - function traceRuleEvaluated(rule, mboxRequest, requestType, ruleContext, ruleSatisfied) { - addCampaign(rule, ruleSatisfied); - addEvaluatedCampaignTarget(rule, ruleContext, ruleSatisfied); + function isReady() { + return isDefined(artifact); } - function traceNotification(rule) { - const { - meta - } = rule; - const activityId = meta[ACTIVITY_ID]; - if (!(campaigns[activityId].notifications instanceof Array)) { - campaigns[activityId].notifications = []; + return ArtifactProvider(_objectSpread2(_objectSpread2({}, config), {}, { + logger + }), telemetryProvider).then(providerInstance => { + artifactProvider = providerInstance; + artifact = artifactProvider.getArtifact(); + if (isUndefined(artifact)) { + throw new Error(Messages.ARTIFACT_NOT_AVAILABLE); } - return notification => { - campaigns[activityId].notifications.push(notification); - }; - } - function toJSON() { + artifactProvider.subscribe(data => { + artifact = data; + }); return { - campaigns: values(campaigns).sort(byOrder).map(campaign => { - const result = _objectSpread2({}, campaign); - delete result.order; - return result; - }), - evaluatedCampaignTargets: values(evaluatedCampaignTargets).sort(byOrder).map(evaluatedCampaignTarget => { - const result = _objectSpread2(_objectSpread2({}, evaluatedCampaignTarget), {}, { - matchedSegmentIds: [...evaluatedCampaignTarget.matchedSegmentIds], - unmatchedSegmentIds: [...evaluatedCampaignTarget.unmatchedSegmentIds] - }); - delete result.order; - return result; - }), - request + getRawArtifact: () => artifact, + stopPolling: () => artifactProvider.stopPolling(), + getOffers: targetOptions => getOffers(targetOptions), + hasRemoteDependency: request => hasRemoteDependency$1(artifact, request), + isReady }; + }); + } + + var tinyEmitter = {exports: {}}; + + function E() { + } + E.prototype = { + on: function (name, callback, ctx) { + var e = this.e || (this.e = {}); + (e[name] || (e[name] = [])).push({ + fn: callback, + ctx: ctx + }); + return this; + }, + once: function (name, callback, ctx) { + var self = this; + function listener() { + self.off(name, listener); + callback.apply(ctx, arguments); + } + listener._ = callback; + return this.on(name, listener, ctx); + }, + emit: function (name) { + var data = [].slice.call(arguments, 1); + var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); + var i = 0; + var len = evtArr.length; + for (i; i < len; i++) { + evtArr[i].fn.apply(evtArr[i].ctx, data); + } + return this; + }, + off: function (name, callback) { + var e = this.e || (this.e = {}); + var evts = e[name]; + var liveEvents = []; + if (evts && callback) { + for (var i = 0, len = evts.length; i < len; i++) { + if (evts[i].fn !== callback && evts[i].fn._ !== callback) liveEvents.push(evts[i]); + } + } + liveEvents.length ? e[name] = liveEvents : delete e[name]; + return this; } - function getTraceResult() { - return traceProvider.wrap(toJSON()); - } + }; + tinyEmitter.exports = E; + tinyEmitter.exports.TinyEmitter = E; + var EventEmitter = tinyEmitter.exports; + + function lowerCaseHeaders(headers) { + const headerKeys = []; + const headerEntries = []; + const headersObj = {}; + Object.keys(headers).forEach(key => { + const headerKey = key.toLowerCase(); + const headerValue = headers[key]; + headerKeys.push(headerKey); + headersObj[headerKey] = headerValue; + headerEntries.push([headerKey, headerValue]); + }); return { - toJSON, - traceRuleEvaluated, - traceRequest, - traceNotification, - getTraceResult + headerKeys, + headerEntries, + headersObj }; } - function ArtifactTracer(artifactLocation, artifactPayload, pollingInterval, pollingHalted, firstArtifact) { - let artifact = firstArtifact; - let artifactRetrievalCount = 1; - let artifactLastRetrieved = new Date(); - function provideNewArtifact(value) { - artifactLastRetrieved = new Date(); - artifactRetrievalCount += 1; - artifact = value; - } - const meta = isDefined(artifact) ? artifact.meta : {}; - function toJSON() { - return _objectSpread2({ - artifactLocation: isObject(artifactPayload) ? Messages.NOT_APPLICABLE : artifactLocation, - pollingInterval, - pollingHalted, - artifactVersion: isDefined(artifact) ? artifact.version : Messages.UNKNOWN, - artifactRetrievalCount, - artifactLastRetrieved: artifactLastRetrieved.toISOString() - }, meta); + function unfetchResponse(responseURL, headers, body) { + let requestStatus = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 200; + let statusText = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ""; + const encoder = new TextEncoder(); + const decoder = new TextDecoder("utf-8"); + let bodyArrayBuffer; + let bodyString; + if (isString(body)) { + bodyString = body; + bodyArrayBuffer = encoder.encode(body).buffer; + } else if (body instanceof ArrayBuffer) { + bodyString = decoder.decode(new DataView(body)); + bodyArrayBuffer = body; } - return { - provideNewArtifact, - toJSON - }; + const { + headerKeys, + headerEntries, + headersObj + } = lowerCaseHeaders(headers); + const response = () => ({ + ok: (requestStatus / 100 | 0) === 2, + statusText, + status: requestStatus, + url: responseURL, + text: () => reactorPromise.resolve(bodyString), + json: () => reactorPromise.resolve(JSON.parse(bodyString)), + blob: () => reactorPromise.resolve(new Blob([bodyArrayBuffer])), + arrayBuffer: () => reactorPromise.resolve(bodyArrayBuffer), + clone: response, + headers: { + keys: () => headerKeys, + entries: () => headerEntries, + get: n => headersObj[n.toLowerCase()], + has: n => n.toLowerCase() in headersObj + } + }); + return response(); } - const RequestType = { - MBOX: "mbox", - VIEW: "view", - PAGELOAD: "pageLoad" - }; - const OptionType = { - Html: "html", - Json: "json", - Redirect: "redirect", - Dynamic: "dynamic", - Actions: "actions" - }; - - const MACRO_PATTERN_REGEX = /\$\{([a-zA-Z0-9_.]*?)\}/gi; - const MACRO_NAME_REPLACEMENTS = { - campaign: "activity", - recipe: "experience" - }; - const MACRO_NAME_REPLACEMENTS_REGEX = new RegExp(Object.keys(MACRO_NAME_REPLACEMENTS).join("|"), "gi"); - const MACRO_NAME_REMOVALS = ["mbox"]; - function noBlankOptions(option) { - return !(isUndefined(option.type) && isUndefined(option.content)); + const hasNativeFetch = typeof window$1 !== "undefined" && typeof window$1.fetch === "function"; + function getFetchResponseFactory() { + return hasNativeFetch ? (url, headers, body) => new Response(new Blob([body], { + headers + })) : unfetchResponse; } - function prepareExecuteResponse(rule, mboxResponse, requestType, requestDetail, tracer) { - const { - metrics = [], - options = [] - } = mboxResponse; - const result = _objectSpread2(_objectSpread2({}, mboxResponse), {}, { - options: options.filter(noBlankOptions).map(pristineOption => { - const option = _objectSpread2({}, pristineOption); - delete option.eventToken; - return option; - }), - metrics: metrics.filter(metric => metric.type === MetricType.Click) - }); - if (result.metrics.length === 0) { - delete result.metrics; + + const TARGET_STORAGE_PREFIX = "tgt"; + const REGEX_TARGET_LOCAL_STORAGE_KEY = /^tgt:.+/i; + const isTargetLocalStorageKey = key => REGEX_TARGET_LOCAL_STORAGE_KEY.test(key); + function localStorageAvailable() { + try { + const storage = window["localStorage"]; + const x = "__storage_test__"; + storage.setItem(x, x); + storage.removeItem(x); + return true; + } catch (e) { + return false; } - return result; } - function preparePrefetchResponse(rule, mboxResponse, requestType, requestDetail, tracer) { - const { - options = [] - } = mboxResponse; - const result = _objectSpread2(_objectSpread2({}, mboxResponse), {}, { - options: options.map((pristineOption, idx) => { - let { - eventToken - } = pristineOption; - if (isUndefined(eventToken) && mboxResponse.metrics.length > idx && mboxResponse.metrics[idx].type === MetricType.Display) { - eventToken = mboxResponse.metrics[idx].eventToken; - } - return _objectSpread2(_objectSpread2({}, pristineOption), {}, { - eventToken - }); - }) - }); - if (requestType !== RequestType.VIEW) { - delete result.metrics; - } - return result; + function clearTargetLocalStorage() { + Object.keys(localStorage).filter(isTargetLocalStorageKey).forEach(key => localStorage.removeItem(key)); } - function addTrace(rule, mboxResponse, requestType, requestDetail, tracer) { - return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { - trace: tracer.getTraceResult() - }); + function storeJsonInLocalStorage(key, jsonValue) { + try { + localStorage.setItem(key, JSON.stringify(jsonValue)); + } catch (err) { + clearTargetLocalStorage(); + } } - function cleanUp(rule, mboxResponse, requestType, requestDetail, tracer) { - const result = objectWithoutUndefinedValues(mboxResponse); - return result; + + const REGEX_RULES_ARTIFACT = /rules\.(json|txt)$/i; + const REGEX_CONTENT_TYPE_JSON = /(application\/json)|(text\/)/i; + const createFetchResponse = getFetchResponseFactory(); + const isArtifactFile = url => url.match(REGEX_RULES_ARTIFACT); + const isJsonContentType = contentType => contentType && contentType.match(REGEX_CONTENT_TYPE_JSON); + const ARTIFACT_FETCH_DELAY = 1000; + const canCacheArtifact = localStorageAvailable(); + function getHeadersCacheKey(url) { + return TARGET_STORAGE_PREFIX + ":" + hashUnencodedChars(url) + ":h"; } - function removePageLoadAttributes(rule, mboxResponse, requestType, requestDetail, tracer) { - const processed = _objectSpread2({}, mboxResponse); - delete processed.index; - delete processed.name; - delete processed.trace; - return processed; + function getBodyCacheKey(url) { + return TARGET_STORAGE_PREFIX + ":" + hashUnencodedChars(url) + ":b"; } - function createResponseTokensPostProcessor(context, responseTokensInArtifact = []) { - const responseTokens = {}; - responseTokens[ACTIVITY_DECISIONING_METHOD] = "on-device"; - if (includes(GEO_CITY, responseTokensInArtifact) && isDefined(context.geo.city)) { - responseTokens[GEO_CITY] = context.geo.city; - } - if (includes(GEO_COUNTRY, responseTokensInArtifact) && isDefined(context.geo.country)) { - responseTokens[GEO_COUNTRY] = context.geo.country; - } - if (includes(GEO_STATE, responseTokensInArtifact) && isDefined(context.geo.region)) { - responseTokens[GEO_STATE] = context.geo.region; - } - if (includes(GEO_LATITUDE, responseTokensInArtifact) && isDefined(context.geo.latitude)) { - responseTokens[GEO_LATITUDE] = context.geo.latitude; - } - if (includes(GEO_LONGITUDE, responseTokensInArtifact) && isDefined(context.geo.longitude)) { - responseTokens[GEO_LONGITUDE] = context.geo.longitude; + function headersAsPOJO(headers) { + const result = {}; + for (const [key, value] of headers.entries()) { + result[key] = value; } - return function addResponseTokens(rule, mboxResponse) { - const meta = rule.meta || {}; - const responseTokensFromMeta = [ACTIVITY_ID, ACTIVITY_NAME, ACTIVITY_TYPE, EXPERIENCE_ID, EXPERIENCE_NAME, LOCATION_ID, LOCATION_NAME, LOCATION_TYPE, OFFER_ID, OFFER_NAME, OPTION_ID, OPTION_NAME].reduce((accumulator, key) => { - if (includes(key, responseTokensInArtifact) && isDefined(meta[key])) { - accumulator[key] = meta[key]; - } - return accumulator; - }, {}); - const options = mboxResponse.options.map(option => { - return _objectSpread2(_objectSpread2({}, option), {}, { - responseTokens: _objectSpread2(_objectSpread2({}, responseTokensFromMeta), responseTokens) - }); - }); - return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { - options - }); - }; + return result; } - function replaceCampaignMacros(rule, mboxResponse, requestType, requestDetail, tracer) { - function addCampainMacroValues(htmlContent) { - if (isUndefined(htmlContent) || !isString(htmlContent)) { - return htmlContent; - } - return htmlContent.replace(MACRO_PATTERN_REGEX, (defaultValue, macroKey) => { - let parts = macroKey.replace(MACRO_NAME_REPLACEMENTS_REGEX, matched => MACRO_NAME_REPLACEMENTS[matched]).split("."); - if (parts.length > 2) { - parts = parts.slice(parts.length - 2); - } - const key = parts.filter(part => !includes(part, MACRO_NAME_REMOVALS)).join("."); - const { - parameters = {} - } = requestDetail; - return firstMatch(key, [rule.meta, requestDetail, parameters], defaultValue); - }); + function getArtifactFromCache(url) { + if (!canCacheArtifact) { + return undefined; } - return _objectSpread2(_objectSpread2({}, mboxResponse), {}, { - options: mboxResponse.options.map( - option => { - if (option.type === OptionType.Html) { - return _objectSpread2(_objectSpread2({}, option), {}, { - content: addCampainMacroValues(option.content) - }); - } - if (option.type === OptionType.Actions) { - return _objectSpread2(_objectSpread2({}, option), {}, { - content: option.content.map(action => { - return _objectSpread2(_objectSpread2({}, action), {}, { - content: addCampainMacroValues(action.content) - }); - }) - }); - } - return option; - }) + const cached = { + headers: localStorage.getItem(getHeadersCacheKey(url)), + body: localStorage.getItem(getBodyCacheKey(url)) + }; + if (cached.headers != null && cached.body != null) { + return cached; + } + return undefined; + } + function storeArtifactInCache(url, response) { + if (!canCacheArtifact) { + return resolve(); + } + const headers = headersAsPOJO(response.headers); + storeJsonInLocalStorage(getHeadersCacheKey(url), headers); + return response.clone().json().then(content => { + storeJsonInLocalStorage(getBodyCacheKey(url), content); }); } - - var logic = createCommonjsModule(function (module, exports) { - (function (root, factory) { - { - module.exports = factory(); - } - })(commonjsGlobal, function () { - if (!Array.isArray) { - Array.isArray = function (arg) { - return Object.prototype.toString.call(arg) === "[object Array]"; - }; - } - function arrayUnique(array) { - var a = []; - for (var i = 0, l = array.length; i < l; i++) { - if (a.indexOf(array[i]) === -1) { - a.push(array[i]); - } - } - return a; + function getFetchWithCaching(fetchApi) { + return function cachedFetch(url, options) { + if (!isArtifactFile(url)) { + return fetchApi(url, options); } - var jsonLogic = {}; - var operations = { - "==": function (a, b) { - return a == b; - }, - "===": function (a, b) { - return a === b; - }, - "!=": function (a, b) { - return a != b; - }, - "!==": function (a, b) { - return a !== b; - }, - ">": function (a, b) { - return a > b; - }, - ">=": function (a, b) { - return a >= b; - }, - "<": function (a, b, c) { - return c === undefined ? a < b : a < b && b < c; - }, - "<=": function (a, b, c) { - return c === undefined ? a <= b : a <= b && b <= c; - }, - "!!": function (a) { - return jsonLogic.truthy(a); - }, - "!": function (a) { - return !jsonLogic.truthy(a); - }, - "%": function (a, b) { - return a % b; - }, - "log": function (a) { - console.log(a); - return a; - }, - "in": function (a, b) { - if (!b || typeof b.indexOf === "undefined") return false; - return b.indexOf(a) !== -1; - }, - "cat": function () { - return Array.prototype.join.call(arguments, ""); - }, - "substr": function (source, start, end) { - if (end < 0) { - var temp = String(source).substr(start); - return temp.substr(0, temp.length + end); - } - return String(source).substr(start, end); - }, - "+": function () { - return Array.prototype.reduce.call(arguments, function (a, b) { - return parseFloat(a, 10) + parseFloat(b, 10); - }, 0); - }, - "*": function () { - return Array.prototype.reduce.call(arguments, function (a, b) { - return parseFloat(a, 10) * parseFloat(b, 10); - }); - }, - "-": function (a, b) { - if (b === undefined) { - return -a; - } else { - return a - b; - } - }, - "/": function (a, b) { - return a / b; - }, - "min": function () { - return Math.min.apply(this, arguments); - }, - "max": function () { - return Math.max.apply(this, arguments); - }, - "merge": function () { - return Array.prototype.reduce.call(arguments, function (a, b) { - return a.concat(b); - }, []); - }, - "var": function (a, b) { - var not_found = b === undefined ? null : b; - var data = this; - if (typeof a === "undefined" || a === "" || a === null) { - return data; - } - var sub_props = String(a).split("."); - for (var i = 0; i < sub_props.length; i++) { - if (data === null || data === undefined) { - return not_found; - } - data = data[sub_props[i]]; - if (data === undefined) { - return not_found; - } - } - return data; - }, - "missing": function () { - var missing = []; - var keys = Array.isArray(arguments[0]) ? arguments[0] : arguments; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var value = jsonLogic.apply({ - "var": key - }, this); - if (value === null || value === "") { - missing.push(key); - } - } - return missing; - }, - "missing_some": function (need_count, options) { - var are_missing = jsonLogic.apply({ - "missing": options - }, this); - if (options.length - are_missing.length >= need_count) { - return []; - } else { - return are_missing; - } - } - }; - jsonLogic.is_logic = function (logic) { - return typeof logic === "object" && - logic !== null && - !Array.isArray(logic) && - Object.keys(logic).length === 1 - ; - }; - jsonLogic.truthy = function (value) { - if (Array.isArray(value) && value.length === 0) { - return false; - } - return !!value; - }; - jsonLogic.get_operator = function (logic) { - return Object.keys(logic)[0]; - }; - jsonLogic.get_values = function (logic) { - return logic[jsonLogic.get_operator(logic)]; - }; - jsonLogic.apply = function (logic, data) { - if (Array.isArray(logic)) { - return logic.map(function (l) { - return jsonLogic.apply(l, data); - }); - } - if (!jsonLogic.is_logic(logic)) { - return logic; - } - var op = jsonLogic.get_operator(logic); - var values = logic[op]; - var i; - var current; - var scopedLogic, scopedData, filtered, initial; - if (!Array.isArray(values)) { - values = [values]; - } - if (op === "if" || op == "?:") { - for (i = 0; i < values.length - 1; i += 2) { - if (jsonLogic.truthy(jsonLogic.apply(values[i], data))) { - return jsonLogic.apply(values[i + 1], data); - } - } - if (values.length === i + 1) return jsonLogic.apply(values[i], data); - return null; - } else if (op === "and") { - for (i = 0; i < values.length; i += 1) { - current = jsonLogic.apply(values[i], data); - if (!jsonLogic.truthy(current)) { - return current; - } - } - return current; - } else if (op === "or") { - for (i = 0; i < values.length; i += 1) { - current = jsonLogic.apply(values[i], data); - if (jsonLogic.truthy(current)) { - return current; - } - } - return current; - } else if (op === 'filter') { - scopedData = jsonLogic.apply(values[0], data); - scopedLogic = values[1]; - if (!Array.isArray(scopedData)) { - return []; - } - return scopedData.filter(function (datum) { - return jsonLogic.truthy(jsonLogic.apply(scopedLogic, datum)); - }); - } else if (op === 'map') { - scopedData = jsonLogic.apply(values[0], data); - scopedLogic = values[1]; - if (!Array.isArray(scopedData)) { - return []; - } - return scopedData.map(function (datum) { - return jsonLogic.apply(scopedLogic, datum); - }); - } else if (op === 'reduce') { - scopedData = jsonLogic.apply(values[0], data); - scopedLogic = values[1]; - initial = typeof values[2] !== 'undefined' ? values[2] : null; - if (!Array.isArray(scopedData)) { - return initial; - } - return scopedData.reduce(function (accumulator, current) { - return jsonLogic.apply(scopedLogic, { - 'current': current, - 'accumulator': accumulator - }); - }, initial); - } else if (op === "all") { - scopedData = jsonLogic.apply(values[0], data); - scopedLogic = values[1]; - if (!scopedData.length) { - return false; - } - for (i = 0; i < scopedData.length; i += 1) { - if (!jsonLogic.truthy(jsonLogic.apply(scopedLogic, scopedData[i]))) { - return false; - } + const cachedArtifact = getArtifactFromCache(url); + function fetchAndCache() { + let additionalOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return fetchApi(url, _objectSpread2(_objectSpread2({}, options), additionalOptions)).then(response => { + if (isJsonContentType(response.headers.get("Content-Type"))) { + storeArtifactInCache(url, response); } - return true; - } else if (op === "none") { - filtered = jsonLogic.apply({ - 'filter': values - }, data); - return filtered.length === 0; - } else if (op === "some") { - filtered = jsonLogic.apply({ - 'filter': values - }, data); - return filtered.length > 0; - } - values = values.map(function (val) { - return jsonLogic.apply(val, data); + return response; }); - if (typeof operations[op] === "function") { - return operations[op].apply(data, values); - } else if (op.indexOf(".") > 0) { - var sub_ops = String(op).split("."); - var operation = operations; - for (i = 0; i < sub_ops.length; i++) { - operation = operation[sub_ops[i]]; - if (operation === undefined) { - throw new Error("Unrecognized operation " + op + " (failed at " + sub_ops.slice(0, i + 1).join(".") + ")"); - } - } - return operation.apply(data, values); - } - throw new Error("Unrecognized operation " + op); + } + if (isDefined(cachedArtifact)) { + $(() => { + setTimeout(() => fetchAndCache(), ARTIFACT_FETCH_DELAY); + }); + return resolve(createFetchResponse(url, JSON.parse(cachedArtifact.headers), cachedArtifact.body)); + } + return fetchAndCache(); + }; + } + function ensureArtifactCached(decisioningConfig) { + if (!canCacheArtifact) { + return decisioningConfig; + } + const cachedArtifact = getArtifactFromCache(determineArtifactLocation(decisioningConfig)); + if (isDefined(cachedArtifact) || isDefined(decisioningConfig.artifactPayload)) { + return decisioningConfig; + } + $(() => { + setTimeout(() => ArtifactProvider(decisioningConfig, window.__target_telemetry), ARTIFACT_FETCH_DELAY); + }); + throw new Error(NO_CACHED_ARTIFACT); + } + + const prop = key => obj => obj[key]; + const not = pred => val => !pred(val); + const notNil = not(isNil); + const notBlank = not(isBlank); + const filterBy = pred => coll => filter(pred, coll); + const isError = val => val.status === ERROR; + const isActions = val => val.type === ACTIONS; + const isRedirect = val => val.type === REDIRECT; + const filterNotNil = filterBy(notNil); + const filterNotBlank = filterBy(notBlank); + const selectOptions = prop(OPTIONS); + const selectContent$1 = prop(CONTENT); + const selectEventToken = prop(EVENT_TOKEN); + const selectResponseTokens = prop(RESPONSE_TOKENS); + const hasName = val => isNotBlank(val.name); + const hasIndex = val => !isNil(val.index); + const isValidMbox = val => isObject(val) && hasName(val); + const isValidPrefetchMbox = val => isObject(val) && hasName(val) && hasIndex(val); + const isValidView = val => isObject(val) && hasName(val); + const hasSelector$1 = val => isNotBlank(val.selector); + const selectData = prop(DATA$1); + const hasData = flow([selectData, notNil]); + function createSuccess(type, data) { + return { + status: SUCCESS, + type, + data + }; + } + function createError$1(type, data) { + return { + status: ERROR, + type, + data + }; + } + function isValidOption$1(option) { + return isObject(option); + } + function isValidOptionEventToken(option) { + if (!isValidOption$1(option)) { + return false; + } + return isNotBlank(option.eventToken); + } + function isValidMetric(metric) { + if (isEmpty(metric) || isBlank(metric.type)) { + return false; + } + return isNotBlank(metric.eventToken); + } + function isValidSelectorMetric(metric) { + if (!isValidMetric(metric)) { + return false; + } + return isNotBlank(metric.selector); + } + function isErrorWithMessage(err, msg) { + return err instanceof Error && err.message === msg; + } + + const DEFAULT_POLLING_INTERVAL = 0; + const eventbus = new EventEmitter(); + let decisioningEnginePromise; + function getDecisioningMethod(config) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return options[DECISIONING_METHOD_SETTING] || config[DECISIONING_METHOD_SETTING]; + } + function isServerSideDecisioningMethod(config) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return getDecisioningMethod(config, options) === DECISIONING_METHOD.SERVER_SIDE; + } + function isHybridDecisioningMethod(config) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return getDecisioningMethod(config, options) === DECISIONING_METHOD.HYBRID; + } + function getPollingInterval(config) { + return isNumber(config[POLLING_INTERVAL_SETTING]) ? config[POLLING_INTERVAL_SETTING] : DEFAULT_POLLING_INTERVAL; + } + function getArtifactLocation(config) { + return config[ARTIFACT_LOCATION_SETTING]; + } + function getArtifactFormat(config) { + return config[ARTIFACT_FORMAT_SETTING]; + } + function getArtifactPayload(config) { + return config[ARTIFACT_PAYLOAD_SETTING]; + } + function getTargetEnvironment(config) { + return config[TARGET_ENVIRONMENT_SETTING]; + } + function getCdnEnvironment(config) { + return config[CDN_ENVIRONMENT_SETTING]; + } + function getTelemetryEnabled(config) { + return config[TELEMETRY_ENABLED_SETTING]; + } + function getCdnBasePath(config) { + return config[CDN_BASEPATH_SETTING]; + } + function decisioningEngineRequired(config) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (isAuthoringEnabled() || isQaMode() || isPreviewMode()) { + return false; + } + return requiresDecisioningEngine(getDecisioningMethod(reactorObjectAssign({}, config), options)); + } + function ifOnDeviceDecisioningPossible(config) { + return !isServerSideDecisioningMethod(config) ? resolve() : reject(new Error(DECISIONING_ENGINE_NOT_READY)); + } + function eventEmitter(eventName, payload) { + const config = getConfig(); + notifyOnDeviceDecisioning(eventName, payload); + eventbus.emit(eventName, payload); + if (eventName !== GEO_LOCATION_UPDATED) { + return; + } + const { + geoContext + } = payload; + if (isDefined(geoContext) && !isEmpty(Object.keys(geoContext))) { + const geoCookieLifetime = 7 * 24 * 60 * 60 * 1000; + const expires = new Date(now() + geoCookieLifetime); + const domain = config[COOKIE_DOMAIN]; + const secure = config[SECURE_ONLY]; + const attrs = reactorObjectAssign({ + expires, + domain, + secure + }, secure ? { + sameSite: SAMESITE_NONE + } : {}); + setCookie(GEO_COOKIE, JSON.stringify(geoContext), attrs); + } + } + function getGeoContext(request) { + const geoCookie = getCookie(GEO_COOKIE); + const geoContext = reactorObjectAssign({}, isDefined(geoCookie) ? JSON.parse(geoCookie) : {}, request.context.geo); + if (isObject(geoContext) && isEmpty(Object.keys(geoContext))) { + return { + ipAddress: UNKNOWN_IP_ADDRESS }; - jsonLogic.uses_data = function (logic) { - var collection = []; - if (jsonLogic.is_logic(logic)) { - var op = jsonLogic.get_operator(logic); - var values = logic[op]; - if (!Array.isArray(values)) { - values = [values]; - } - if (op === "var") { - collection.push(values[0]); - } else { - values.map(function (val) { - collection.push.apply(collection, jsonLogic.uses_data(val)); - }); - } + } + return geoContext; + } + function prepareDecisioningConfig(config, sendNotificationFn, customFetch) { + const targetPageParams = getTargetPageParams(config[GLOBAL_MBOX_NAME]); + const propertyToken = getPropertyToken(targetPageParams); + const CONF = { + client: config[CLIENT_CODE], + organizationId: config[IMS_ORG_ID], + pollingInterval: getPollingInterval(config), + propertyToken, + environment: getTargetEnvironment(config), + cdnEnvironment: getCdnEnvironment(config), + cdnBasePath: getCdnBasePath(config), + telemetryEnabled: getTelemetryEnabled(config), + eventEmitter, + logger, + fetchApi: getFetchWithCaching(isFunction(customFetch) ? customFetch : getFetchApi(isFunction(window$1.fetch) ? window$1.fetch : noopPromise)), + sendNotificationFunc: options => { + logDebug("sendNotificationFunc", options); + const { + request + } = options; + if (isFunction(sendNotificationFn)) { + sendNotificationFn(request); } - return arrayUnique(collection); - }; - jsonLogic.add_operation = function (name, code) { - operations[name] = code; + } + }; + const artifactPayload = getArtifactPayload(config); + return resolve(isDefined(artifactPayload) ? _objectSpread2(_objectSpread2({}, CONF), {}, { + artifactPayload + }) : _objectSpread2(_objectSpread2({}, CONF), {}, { + artifactFormat: getArtifactFormat(config), + artifactLocation: getArtifactLocation(config) + })); + } + function abortIfHybridAndArtifactNotCached(config, decisioningConfig) { + return isHybridDecisioningMethod(config) ? ensureArtifactCached(decisioningConfig) : decisioningConfig; + } + function bootstrapDecisioningEngine(config, sendNotificationFn) { + let customFetch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + if (!decisioningEngineRequired(config)) { + return; + } + decisioningEnginePromise = undefined; + decisioningEnginePromise = prepareDecisioningConfig(config, sendNotificationFn, customFetch).then(decisioningConfig => abortIfHybridAndArtifactNotCached(config, decisioningConfig)).then(decisioningConfig => TargetDecisioningEngine(decisioningConfig, window$1.__target_telemetry)).then(instance => { + return instance; + })['catch'](err => { + if (isErrorWithMessage(err, NO_CACHED_ARTIFACT)) { + eventbus.once(ARTIFACT_DOWNLOAD_SUCCEEDED, payload => bootstrapDecisioningEngine(_objectSpread2(_objectSpread2({}, config), {}, { + artifactPayload: payload.artifactPayload + }), sendNotificationFn, customFetch)); + } + logDebug(err.message); + throw err; + }); + } + function whenDecisioningEngineIsReady() { + return isDefined(decisioningEnginePromise) ? decisioningEnginePromise : reject(); + } + function executeDecisioningRequest(request) { + const { + context = {} + } = request; + return whenDecisioningEngineIsReady().then(decisioningEngine => { + perfTool.timeStart(request.requestId); + return decisioningEngine.getOffers({ + request: _objectSpread2(_objectSpread2({}, request), {}, { + context: _objectSpread2(_objectSpread2({}, context), {}, { + geo: getGeoContext(request) + }) + }), + targetLocationHint: getEdgeCluster() + }).then(response => { + const executionTime = perfTool.timeEnd(request.requestId); + window$1.__target_telemetry.addDeliveryRequestEntry(request, { + execution: executionTime, + parsing: response.parsingTime + }, response.status, DECISIONING_METHOD.ON_DEVICE); + return reactorObjectAssign(response, { + decisioningMethod: DECISIONING_METHOD.ON_DEVICE + }); + }); + }); + } + function hasRemoteDependency(request) { + return whenDecisioningEngineIsReady().then(decisioningEngine => decisioningEngine.hasRemoteDependency(request)); + } + + const POST$1 = "POST"; + const NETWORK_ERROR$1 = "Network request failed"; + const REQUEST_TIMEOUT$1 = "Request timed out"; + const MALFORMED_RESPONSE = "Malformed response JSON"; + function addOnload$1(xhr, resolve, reject) { + xhr.onload = () => { + const status = xhr.status === 1223 ? 204 : xhr.status; + if (status < 100 || status > 599) { + reject(new Error(NETWORK_ERROR$1)); + return; + } + let response; + try { + const startTime = performanceNow(); + response = JSON.parse(xhr.responseText); + response.parsingTime = performanceNow() - startTime; + response.responseSize = new Blob([xhr.responseText]).size; + } catch (e) { + reject(new Error(MALFORMED_RESPONSE)); + return; + } + const headers = xhr.getAllResponseHeaders(); + resolve({ + status, + headers, + response + }); + }; + return xhr; + } + function addOnerror$1(xhr, reject) { + xhr.onerror = () => { + reject(new Error(NETWORK_ERROR$1)); + }; + return xhr; + } + function addOntimeout$1(xhr, timeout, reject) { + xhr.timeout = timeout; + xhr.ontimeout = () => { + reject(new Error(REQUEST_TIMEOUT$1)); + }; + return xhr; + } + function addHeaders$1(xhr) { + let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + forEach((values, key) => { + if (!isArray$1(values)) { + return; + } + forEach(value => { + xhr.setRequestHeader(key, value); + }, values); + }, headers); + return xhr; + } + function executeXhr(_ref) { + let { + url, + headers, + body, + timeout, + async + } = _ref; + return create$1((resolve, reject) => { + let xhr = new window.XMLHttpRequest(); + xhr = addOnload$1(xhr, resolve, reject); + xhr = addOnerror$1(xhr, reject); + xhr.open(POST$1, url, async); + xhr.withCredentials = true; + xhr = addHeaders$1(xhr, headers); + if (async) { + xhr = addOntimeout$1(xhr, timeout, reject); + } + xhr.send(JSON.stringify(body)); + }).then(xhrResponse => { + const { + response + } = xhrResponse; + const { + status, + message + } = response; + if (!isNil(status) && !isNil(message)) { + throw new Error(message); + } + return response; + }); + } + + const EDGE_SERVER_PREFIX = "mboxedge"; + const EDGE_SERVER_DOMAIN = ".tt.omtrdc.net"; + function getRequestTimings(url, response) { + if (!performance) { + return null; + } + const resources = performance.getEntriesByType("resource"); + const timings = resources.find(resource => resource.name.endsWith(url)); + if (!timings) { + return null; + } + const requestTimings = {}; + if (timings.domainLookupEnd && timings.domainLookupStart) { + requestTimings.dns = timings.domainLookupEnd - timings.domainLookupStart; + } + if (timings.secureConnectionStart && timings.connectEnd) { + requestTimings.tls = timings.connectEnd - timings.secureConnectionStart; + } + if (timings.responseStart) { + requestTimings.timeToFirstByte = timings.responseStart - timings.requestStart; + } + if (timings.responseEnd && timings.responseStart) { + requestTimings.download = timings.responseEnd - timings.responseStart; + } + if (timings.encodedBodySize) { + requestTimings.responseSize = timings.encodedBodySize; + } else if (response.responseSize) { + requestTimings.responseSize = response.responseSize; + delete response.responseSize; + } + return requestTimings; + } + function getTimeout(config, timeout) { + if (!isNumber(timeout)) { + return config[TIMEOUT$1]; + } + if (timeout < 0) { + return config[TIMEOUT$1]; + } + return timeout; + } + function getServerDomain(config) { + const serverDomain = config[SERVER_DOMAIN]; + const overrideMboxEdgeServer = config[OVERRIDE_MBOX_EDGE_SERVER]; + if (!overrideMboxEdgeServer) { + return serverDomain; + } + const cluster = getEdgeCluster(); + if (isBlank(cluster)) { + return serverDomain; + } + return "" + EDGE_SERVER_PREFIX + cluster + EDGE_SERVER_DOMAIN; + } + function createRequestUrl(config) { + const scheme = config[SCHEME]; + const host = getServerDomain(config); + const path = config[ENDPOINT]; + const client = config[CLIENT_CODE]; + const sessionId = getSessionId(); + const version = config[VERSION]; + const queryString = stringifyQueryString({ + client, + sessionId, + version + }); + return scheme + "//" + host + path + "?" + queryString; + } + function executeDeliveryRequest(request, requestTimeout, telemetryDecisioningMethod) { + const config = getConfig(); + const url = createRequestUrl(config); + const headers = { + [CONTENT_TYPE]: [TEXT_PLAIN] + }; + const timeout = getTimeout(config, requestTimeout); + const async = true; + const options = { + url, + headers, + body: request, + timeout, + async + }; + perfTool.timeStart(request.requestId); + return executeXhr(options).then(response => { + const executionTime = perfTool.timeEnd(request.requestId); + const telemetryEntry = { + execution: executionTime, + parsing: response.parsingTime }; - jsonLogic.rm_operation = function (name) { - delete operations[name]; + delete response.parsingTime; + const timings = getRequestTimings(url, response); + if (timings) { + telemetryEntry.request = timings; + } + if (response.telemetryServerToken) { + telemetryEntry.telemetryServerToken = response.telemetryServerToken; + } + window.__target_telemetry.addDeliveryRequestEntry(request, telemetryEntry, response.status, telemetryDecisioningMethod); + return reactorObjectAssign(response, { + decisioningMethod: DECISIONING_METHOD.SERVER_SIDE + }); + }); + } + + const notEmpty$1 = val => !isEmpty(val); + function throwIfOptout$1(values) { + const optout = values[MCOPTOUT]; + if (optout) { + throw new Error(OPTOUT_MESSAGE); + } + return values; + } + function getAsyncThirdPartyData$1() { + const visitorValues = getAsyncVisitorValues(); + const dataProvidersParams = getAsyncDataProvidersParameters(); + return all([visitorValues.then(throwIfOptout$1), dataProvidersParams]); + } + function getAllParams$1(providersParams) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + return reactorObjectAssign({}, providersParams, getTargetPageParams(globalMbox)); + } + function getTimeOffset$1() { + return -new Date().getTimezoneOffset(); + } + function createScreen$1() { + const { + screen + } = window$1; + return { + width: screen.width, + height: screen.height, + orientation: getScreenOrientation(), + colorDepth: screen.colorDepth, + pixelRatio: getPixelRatio() + }; + } + function createWindow$1() { + const { + documentElement + } = document$1; + return { + width: documentElement.clientWidth, + height: documentElement.clientHeight + }; + } + function createBrowser$1() { + const { + location + } = window$1; + return { + host: location.hostname, + webGLRenderer: getWebGLRenderer() + }; + } + function createAddress$1() { + const { + location + } = window$1; + return { + url: location.href, + referringUrl: document$1.referrer + }; + } + function createContext$1(context) { + if (!isNil(context) && context.channel === WEB_CHANNEL) { + return context; + } + const validContext = context || {}; + const { + beacon + } = validContext; + return { + userAgent: window$1.navigator.userAgent, + timeOffsetInMinutes: getTimeOffset$1(), + channel: WEB_CHANNEL, + screen: createScreen$1(), + window: createWindow$1(), + browser: createBrowser$1(), + address: createAddress$1(), + geo: context && context.geo, + beacon + }; + } + function createAudienceManager$1(audienceManager, visitorValues) { + if (!isNil(audienceManager)) { + return audienceManager; + } + const result = {}; + if (isEmpty(visitorValues)) { + return result; + } + const locationHint = visitorValues[MCAAMLH]; + const locationHintNumber = parseInt(locationHint, 10); + if (!isNaN(locationHintNumber)) { + result.locationHint = locationHintNumber; + } + const blob = visitorValues[MCAAMB]; + if (isNotBlank(blob)) { + result.blob = blob; + } + return result; + } + function createCustomerId$1(data) { + const { + id, + integrationCode, + authenticatedState, + type, + primary + } = data; + const result = {}; + if (isNotBlank(id)) { + result.id = id; + } + if (isNotBlank(integrationCode)) { + result.integrationCode = integrationCode; + } + if (isNotBlank(authenticatedState)) { + result.authenticatedState = authenticatedState; + } + if (isNotBlank(type)) { + result.type = type; + } + if (primary) { + result.primary = primary; + } + return result; + } + function createCustomerIds$1(customerIdsValues) { + return map(createCustomerId$1, customerIdsValues); + } + function createVisitorId$1(id, deviceId, thirdPartyId, visitorValues, customerIdsValues) { + const result = {}; + if (isNotBlank(deviceId)) { + result.tntId = deviceId; + } + if (isNotBlank(thirdPartyId)) { + result.thirdPartyId = thirdPartyId; + } + if (isNotBlank(id.thirdPartyId)) { + result.thirdPartyId = id.thirdPartyId; + } + const mid = visitorValues[MCMID]; + if (isNotBlank(mid)) { + result.marketingCloudVisitorId = mid; + } + if (isNotBlank(id.marketingCloudVisitorId)) { + result.marketingCloudVisitorId = id.marketingCloudVisitorId; + } + if (!isEmpty(id.customerIds)) { + result.customerIds = id.customerIds; + return result; + } + if (!isEmpty(customerIdsValues)) { + result.customerIds = createCustomerIds$1(customerIdsValues); + } + return result; + } + function createExperienceCloud$1(experienceCloud, visitorValues) { + const result = {}; + const audienceManager = createAudienceManager$1(experienceCloud.audienceManager, visitorValues); + if (!isEmpty(audienceManager)) { + result.audienceManager = audienceManager; + } + if (!isEmpty(experienceCloud.analytics)) { + result.analytics = experienceCloud.analytics; + } + return result; + } + function createProperty$1(property, allParams) { + if (!isNil(property) && isNotBlank(property.token)) { + return property; + } + const result = {}; + const token = getPropertyToken(allParams); + if (isNotBlank(token)) { + result.token = token; + } + return result; + } + function createTrace$1(trace) { + if (!isNil(trace) && isNotBlank(trace.authorizationToken)) { + return trace; + } + const result = {}; + const authorizationToken = getTraceToken(); + if (isNotBlank(authorizationToken)) { + result.authorizationToken = authorizationToken; + } + return result; + } + function createPreview$1(preview) { + if (!isNil(preview)) { + return preview; + } + return getPreview(); + } + function createQaMode$1(qaMode) { + if (!isNil(qaMode)) { + return qaMode; + } + return getQaMode(); + } + function createOrder$1(params) { + const result = {}; + const orderId = getOrderId(params); + if (!isNil(orderId)) { + result.id = orderId; + } + const orderTotal = getOrderTotal(params); + const orderTotalNumber = parseFloat(orderTotal); + if (!isNaN(orderTotalNumber)) { + result.total = orderTotalNumber; + } + const purchasedProductIds = getPurchasedProductIds(params); + if (!isEmpty(purchasedProductIds)) { + result.purchasedProductIds = purchasedProductIds; + } + return result; + } + function createProduct$1(params) { + const result = {}; + const productId = getProductId(params); + if (!isNil(productId)) { + result.id = productId; + } + const categoryId = getCategoryId(params); + if (!isNil(categoryId)) { + result.categoryId = categoryId; + } + return result; + } + function createRequestDetails$1(item, allParams) { + const result = {}; + const params = reactorObjectAssign({}, getParams(allParams), getParams(item.parameters || {})); + const profileParams = reactorObjectAssign({}, getProfileParams(allParams), getProfileParams(item.profileParameters || {}, false)); + const order = reactorObjectAssign({}, createOrder$1(allParams), item.order || {}); + const product = reactorObjectAssign({}, createProduct$1(allParams), item.product || {}); + if (!isEmpty(params)) { + result.parameters = params; + } + if (!isEmpty(profileParams)) { + result.profileParameters = profileParams; + } + if (!isEmpty(order)) { + result.order = order; + } + if (!isEmpty(product)) { + result.product = product; + } + return result; + } + function createMboxRequestDetails$1(item, allParams) { + let providersParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const { + index, + name, + address + } = item; + const params = reactorObjectAssign({}, name === globalMbox ? allParams : providersParams, getTargetPageParams(name)); + const result = createRequestDetails$1(item, params); + if (!isNil(index)) { + result.index = index; + } + if (isNotBlank(name)) { + result.name = name; + } + if (!isEmpty(address)) { + result.address = address; + } + return result; + } + function createViewRequestDetails$1(item, allParams) { + const { + name, + address + } = item; + const result = createRequestDetails$1(item, allParams); + if (isNotBlank(name)) { + result.name = name; + } + if (!isEmpty(address)) { + result.address = address; + } + return result; + } + function createExecute$1(request, allParams, providersParams) { + const { + execute = {} + } = request; + const result = {}; + if (isEmpty(execute)) { + return result; + } + const { + pageLoad + } = execute; + if (!isNil(pageLoad)) { + result.pageLoad = createRequestDetails$1(pageLoad, allParams); + } + const { + mboxes + } = execute; + if (!isNil(mboxes) && isArray$1(mboxes) && !isEmpty(mboxes)) { + const temp = filter(notEmpty$1, map(e => createMboxRequestDetails$1(e, allParams, providersParams), mboxes)); + if (!isEmpty(temp)) { + result.mboxes = temp; + } + } + return result; + } + function createPrefetch$1(request, allParams, providersParams) { + const { + prefetch = {} + } = request; + const result = {}; + if (isEmpty(prefetch)) { + return result; + } + const { + mboxes + } = prefetch; + if (!isNil(mboxes) && isArray$1(mboxes) && !isEmpty(mboxes)) { + result.mboxes = map(e => createMboxRequestDetails$1(e, allParams, providersParams), mboxes); + } + const { + views + } = prefetch; + if (!isNil(views) && isArray$1(views) && !isEmpty(views)) { + result.views = map(e => createViewRequestDetails$1(e, allParams), views); + } + return result; + } + function createAnalytics$1(consumerId, request) { + if (shouldUseOptin() && !isAnalyticsApproved()) { + return null; + } + const config = getConfig(); + const sdid = getSdidVisitorValue(consumerId); + const server = getVisitorProperty(TRACK_SERVER_PROP); + const serverSecure = getVisitorProperty(TRACK_SERVER_SECURE_PROP); + const { + experienceCloud = {} + } = request; + const { + analytics = {} + } = experienceCloud; + const { + logging, + supplementalDataId, + trackingServer, + trackingServerSecure + } = analytics; + const result = {}; + if (!isNil(logging)) { + result.logging = logging; + } else { + result.logging = config[ANALYTICS_LOGGING]; + } + if (!isNil(supplementalDataId)) { + result.supplementalDataId = supplementalDataId; + } + if (isNotBlank(sdid)) { + result.supplementalDataId = sdid; + } + if (!isNil(trackingServer)) { + result.trackingServer = trackingServer; + } + if (isNotBlank(server)) { + result.trackingServer = server; + } + if (!isNil(trackingServerSecure)) { + result.trackingServerSecure = trackingServerSecure; + } + if (isNotBlank(serverSecure)) { + result.trackingServerSecure = serverSecure; + } + if (isEmpty(result)) { + return null; + } + return result; + } + function createDeliveryRequest$1(request, visitorValues, providersParams) { + const allParams = getAllParams$1(providersParams); + const deviceId = getDeviceId(); + const thirdPartyId = getThirdPartyId(allParams); + const customerIdsValues = getCustomerIdsVisitorValues(); + const visitorId = createVisitorId$1(request.id || {}, deviceId, thirdPartyId, visitorValues, customerIdsValues); + const property = createProperty$1(request.property, allParams); + const experienceCloud = createExperienceCloud$1(request.experienceCloud || {}, visitorValues); + const trace = createTrace$1(request.trace); + const preview = createPreview$1(request.preview); + const qaMode = createQaMode$1(request.qaMode); + const execute = createExecute$1(request, allParams, providersParams); + const prefetch = createPrefetch$1(request, allParams, providersParams); + const { + notifications + } = request; + const result = {}; + result.requestId = uuid(); + result.context = createContext$1(request.context); + if (!isEmpty(visitorId)) { + result.id = visitorId; + } + if (!isEmpty(property)) { + result.property = property; + } + if (!isEmpty(trace)) { + result.trace = trace; + } + if (!isEmpty(experienceCloud)) { + result.experienceCloud = experienceCloud; + } + if (!isEmpty(preview)) { + result.preview = preview; + } + if (!isEmpty(qaMode)) { + result.qaMode = qaMode; + } + if (!isEmpty(execute)) { + result.execute = execute; + } + if (!isEmpty(prefetch)) { + result.prefetch = prefetch; + } + if (!isEmpty(notifications)) { + result.notifications = notifications; + } + return result; + } + function buildRequest$1(request, params, data) { + const visitorValues = data[0]; + const providersValues = data[1]; + const providersParams = reactorObjectAssign({}, providersValues, params); + return createDeliveryRequest$1(request, visitorValues, providersParams); + } + function createAsyncDeliveryRequest$1(request, params) { + return getAsyncThirdPartyData$1().then(data => buildRequest$1(request, params, data)); + } + function prepareExecuteRequest(config, options, request, requestTimeout) { + const decisioningMethod = getDecisioningMethod(config, options); + if (!decisioningEngineRequired(config, options)) { + return executeDeliveryRequest(request, requestTimeout, decisioningMethod); + } + return ifOnDeviceDecisioningPossible(config).then(() => hasRemoteDependency(request)).then(dependency => { + if (decisioningMethod === DECISIONING_METHOD.HYBRID && dependency.remoteNeeded) { + return executeDeliveryRequest(request, requestTimeout, decisioningMethod); + } + return executeDecisioningRequest(request); + })['catch'](err => { + if (decisioningMethod === DECISIONING_METHOD.HYBRID) { + return executeDeliveryRequest(request, requestTimeout, decisioningMethod); + } + throw err; + }); + } + function executeRequest(options, request, requestTimeout) { + const config = getConfig(); + logDebug(REQUEST, request); + addClientTrace({ + request + }); + return prepareExecuteRequest(config, options, request, requestTimeout).then(response => { + logDebug(RESPONSE, response); + addClientTrace({ + response + }); + return { + request, + response }; - jsonLogic.rule_like = function (rule, pattern) { - if (pattern === rule) { - return true; - } - if (pattern === "@") { - return true; - } - if (pattern === "number") { - return typeof rule === "number"; - } - if (pattern === "string") { - return typeof rule === "string"; - } - if (pattern === "array") { - return Array.isArray(rule) && !jsonLogic.is_logic(rule); + }); + } + + function hasDeviceId(res) { + const { + id + } = res; + return isObject(id) && isNotBlank(id.tntId); + } + function handleDeviceId(context) { + const { + response + } = context; + if (hasDeviceId(response)) { + setDeviceId(response.id.tntId); + } + return context; + } + + function handleEdgeCluster(context) { + const { + response + } = context; + if (hasDeviceId(response)) { + const { + id + } = response; + const { + tntId + } = id; + setEdgeCluster(tntId); + } + setEdgeCluster(null); + return context; + } + + function addTraceIfExists() { + let item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + trace + } = item; + if (!isEmpty(trace)) { + addServerTrace(trace); + } + } + function handleTraces(httpContext) { + const { + response + } = httpContext; + const { + execute = {}, + prefetch = {}, + notifications = {} + } = response; + const { + pageLoad = {}, + mboxes = [] + } = execute; + const { + mboxes: prefetchMboxes = [], + views = [] + } = prefetch; + addTraceIfExists(pageLoad); + forEach(addTraceIfExists, mboxes); + forEach(addTraceIfExists, prefetchMboxes); + forEach(addTraceIfExists, views); + forEach(addTraceIfExists, notifications); + return httpContext; + } + + const SDID_PARAM = "adobe_mc_sdid"; + function getRedirectUriParams(uri) { + const result = uri.queryKey; + const param = result[SDID_PARAM]; + if (!isString(param)) { + return result; + } + if (isBlank(param)) { + return result; + } + const nowInSeconds = Math.round(now() / 1000); + result[SDID_PARAM] = param.replace(/\|TS=\d+/, "|TS=" + nowInSeconds); + return result; + } + function getUriParams(uri) { + return uri.queryKey; + } + function createUrlInternal(url, params, uriParamsFunc) { + const parsedUri = parseUri(url); + const { + protocol + } = parsedUri; + const { + host + } = parsedUri; + const { + path + } = parsedUri; + const port = parsedUri.port === "" ? "" : ":" + parsedUri.port; + const anchor = isBlank(parsedUri.anchor) ? "" : "#" + parsedUri.anchor; + const uriParams = uriParamsFunc(parsedUri); + const queryString = stringifyQueryString(reactorObjectAssign({}, uriParams, params)); + const query = isBlank(queryString) ? "" : "?" + queryString; + return protocol + "://" + host + port + path + query + anchor; + } + function createRedirectUrl(url, params) { + return createUrlInternal(url, params, getRedirectUriParams); + } + function createUrl(url, params) { + return createUrlInternal(url, params, getUriParams); + } + + function createRedirectOption(option) { + const url = option.content; + if (isBlank(url)) { + logDebug(EMPTY_URL, option); + return null; + } + const result = reactorObjectAssign({}, option); + result.content = createRedirectUrl(url, {}); + return result; + } + + const NETWORK_ERROR = "Network request failed"; + const REQUEST_TIMEOUT = "Request timed out"; + const URL_REQUIRED = "URL is required"; + const GET = "GET"; + const POST = "POST"; + const METHOD = "method"; + const URL = "url"; + const HEADERS = "headers"; + const DATA = "data"; + const CREDENTIALS = "credentials"; + const TIMEOUT = "timeout"; + const ASYNC = "async"; + function throwError(message) { + throw new Error(message); + } + function processOptions$2(options) { + const method = options[METHOD] || GET; + const url = options[URL] || throwError(URL_REQUIRED); + const headers = options[HEADERS] || {}; + const data = options[DATA] || null; + const credentials = options[CREDENTIALS] || false; + const timeout = options[TIMEOUT] || 3000; + const async = isNil(options[ASYNC]) ? true : options[ASYNC] === true; + const result = {}; + result[METHOD] = method; + result[URL] = url; + result[HEADERS] = headers; + result[DATA] = data; + result[CREDENTIALS] = credentials; + result[TIMEOUT] = timeout; + result[ASYNC] = async; + return result; + } + function addOnload(xhr, resolve, reject) { + xhr.onload = () => { + const status = xhr.status === 1223 ? 204 : xhr.status; + if (status < 100 || status > 599) { + reject(new Error(NETWORK_ERROR)); + return; + } + const response = xhr.responseText; + const headers = xhr.getAllResponseHeaders(); + const result = { + status, + headers, + response + }; + resolve(result); + }; + return xhr; + } + function addOnerror(xhr, reject) { + xhr.onerror = () => { + reject(new Error(NETWORK_ERROR)); + }; + return xhr; + } + function addOntimeout(xhr, timeout, reject) { + xhr.timeout = timeout; + xhr.ontimeout = () => { + reject(new Error(REQUEST_TIMEOUT)); + }; + return xhr; + } + function addCredentials(xhr, credentials) { + if (credentials === true) { + xhr.withCredentials = credentials; + } + return xhr; + } + function addHeaders(xhr, headers) { + forEach((value, key) => { + forEach(v => xhr.setRequestHeader(key, v), value); + }, headers); + return xhr; + } + function createXhrPromise(win, opts) { + const options = processOptions$2(opts); + const method = options[METHOD]; + const url = options[URL]; + const headers = options[HEADERS]; + const data = options[DATA]; + const credentials = options[CREDENTIALS]; + const timeout = options[TIMEOUT]; + const async = options[ASYNC]; + return create$1((resolve, reject) => { + let xhr = new win.XMLHttpRequest(); + xhr = addOnload(xhr, resolve, reject); + xhr = addOnerror(xhr, reject); + xhr.open(method, url, async); + xhr = addCredentials(xhr, credentials); + xhr = addHeaders(xhr, headers); + if (async) { + xhr = addOntimeout(xhr, timeout, reject); + } + xhr.send(data); + }); + } + + function xhr(options) { + return createXhrPromise(window$1, options); + } + + function createOptions(url, params, timeout) { + const result = {}; + result[METHOD] = GET; + result[URL] = createUrl(url, params); + result[TIMEOUT] = timeout; + return result; + } + function isSuccess(status) { + return status >= 200 && status < 300 || status === 304; + } + function createOption(res) { + const { + status + } = res; + if (!isSuccess(status)) { + return null; + } + const content = res.response; + if (isBlank(content)) { + return null; + } + const result = {}; + result.type = HTML; + result.content = content; + return result; + } + function createHtmlOption(option) { + const { + content + } = option; + const config = getConfig(); + const timeout = config[TIMEOUT]; + return xhr(createOptions(content, {}, timeout)).then(createOption)['catch'](() => null); + } + + const CLICK_TRACK_PATTERN = /CLKTRK#(\S+)/; + const CLICK_TRACK_REPLACE_PATTERN = /CLKTRK#(\S+)\s/; + function getClickTrackNodeId(action) { + const selector = action[SELECTOR]; + if (isBlank(selector)) { + return ""; + } + const result = CLICK_TRACK_PATTERN.exec(selector); + if (isEmpty(result) || result.length !== 2) { + return ""; + } + return result[1]; + } + function getContent(id, content) { + const div = document.createElement(DIV_TAG); + div.innerHTML = content; + const firstElement = div.firstElementChild; + if (isNil(firstElement)) { + return content; + } + firstElement.id = id; + return firstElement.outerHTML; + } + function processClickTrackId(action) { + const content = action[CONTENT]; + const nodeId = getClickTrackNodeId(action); + if (isBlank(nodeId) || isBlank(content)) { + return action; + } + const selector = action[SELECTOR]; + action[SELECTOR] = selector.replace(CLICK_TRACK_REPLACE_PATTERN, ""); + action[CONTENT] = getContent(nodeId, content); + return action; + } + + const notNull = val => !isNil(val); + function hasSelector(action) { + const { + selector + } = action; + return !isNil(selector); + } + function setHtml$2(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function setText$3(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function appendHtml$2(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function prependHtml$2(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function replaceHtml$2(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function insertBefore$3(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function insertAfter$3(action) { + if (!hasSelector(action)) { + return null; + } + const result = processClickTrackId(action); + const content = result[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, result); + return null; + } + return result; + } + function customCode$3(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_CONTENT, action); + return null; + } + return action; + } + function setAttribute$3(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isObject(content)) { + logDebug(EMPTY_ATTRIBUTE, action); + return null; + } + return action; + } + function setImageSource$2(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isString(content)) { + logDebug(EMPTY_IMAGE_URL, action); + return null; + } + return action; + } + function setStyle$3(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isObject(content)) { + logDebug(EMPTY_PROPERTY, action); + return null; + } + return action; + } + function resize$2(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isObject(content)) { + logDebug(EMPTY_SIZES, action); + return null; + } + return action; + } + function move$2(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isObject(content)) { + logDebug(EMPTY_COORDINATES, action); + return null; + } + return action; + } + function remove$3(action) { + if (!hasSelector(action)) { + return null; + } + return action; + } + function rearrange$3(action) { + if (!hasSelector(action)) { + return null; + } + const content = action[CONTENT]; + if (!isObject(content)) { + logDebug(EMPTY_REARRANGE, action); + return null; + } + return action; + } + function redirect$2(action) { + const { + content + } = action; + if (isBlank(content)) { + logDebug(EMPTY_URL, action); + return null; + } + action.content = createRedirectUrl(content, {}); + return action; + } + function processAction(action) { + const type = action[TYPE]; + if (isBlank(type)) { + return null; + } + switch (type) { + case SET_HTML: + return setHtml$2(action); + case SET_TEXT: + return setText$3(action); + case APPEND_HTML: + return appendHtml$2(action); + case PREPEND_HTML: + return prependHtml$2(action); + case REPLACE_HTML: + return replaceHtml$2(action); + case INSERT_BEFORE: + return insertBefore$3(action); + case INSERT_AFTER: + return insertAfter$3(action); + case CUSTOM_CODE: + return customCode$3(action); + case SET_ATTRIBUTE: + return setAttribute$3(action); + case SET_IMAGE_SOURCE: + return setImageSource$2(action); + case SET_STYLE: + return setStyle$3(action); + case RESIZE: + return resize$2(action); + case MOVE: + return move$2(action); + case REMOVE: + return remove$3(action); + case REARRANGE: + return rearrange$3(action); + case REDIRECT: + return redirect$2(action); + default: + return null; + } + } + function createActionsOption(option) { + const actions = option[CONTENT]; + if (!isArray$1(actions)) { + return null; + } + if (isEmpty(actions)) { + return null; + } + const processedActions = filter(notNull, map(processAction, actions)); + if (isEmpty(processedActions)) { + return null; + } + const result = reactorObjectAssign({}, option); + result.content = processedActions; + return result; + } + + function getTokens() { + let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + options + } = value; + if (!isArray$1(options)) { + return []; + } + if (isEmpty(options)) { + return []; + } + return filterNotNil(map(selectResponseTokens, options)); + } + function getResponseTokens() { + let response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + execute = {}, + prefetch = {} + } = response; + const { + pageLoad = {}, + mboxes = [] + } = execute; + const { + mboxes: prefetchMboxes = [], + views = [] + } = prefetch; + const pageLoadTokens = getTokens(pageLoad); + const mboxesTokens = flatten(map(getTokens, mboxes)); + const prefetchMboxesTokens = flatten(map(getTokens, prefetchMboxes)); + const viewsTokens = flatten(map(getTokens, views)); + return flatten([pageLoadTokens, mboxesTokens, prefetchMboxesTokens, viewsTokens]); + } + + function getRedirect() { + let response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + execute = {} + } = response; + const { + pageLoad = {}, + mboxes = [] + } = execute; + const pageLoadOpts = selectOptions(pageLoad) || []; + const mboxesOpts = flatten(filterNotNil(map(selectOptions, mboxes))); + const options = flatten([pageLoadOpts, mboxesOpts]); + const actions = flatten(map(selectContent$1, filter(isActions, options))); + const redirectOptions = filter(isRedirect, options); + const redirectActions = filter(isRedirect, actions); + const redirects = redirectOptions.concat(redirectActions); + const result = {}; + if (isEmpty(redirects)) { + return result; + } + const redirect = redirects[0]; + const url = redirect.content; + if (isBlank(url)) { + return result; + } + result.url = url; + return result; + } + + function getAnalytics() { + let item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + analytics + } = item; + return isEmpty(analytics) ? [] : [analytics]; + } + function getAnalyticsDetails() { + let response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + execute = {}, + prefetch = {} + } = response; + const { + pageLoad = {}, + mboxes = [] + } = execute; + const { + mboxes: prefetchMboxes = [], + views = [], + metrics = [] + } = prefetch; + const pageLoadDetails = getAnalytics(pageLoad); + const mboxesDetails = flatten(map(getAnalytics, mboxes)); + const prefetchMboxesDetails = flatten(map(getAnalytics, prefetchMboxes)); + const viewsDetails = flatten(map(getAnalytics, views)); + const prefetchMetrics = flatten(map(getAnalytics, metrics)); + return flatten([pageLoadDetails, mboxesDetails, prefetchMboxesDetails, viewsDetails, prefetchMetrics]); + } + + function addContextDetails(to, from) { + to.parameters = from.parameters; + to.profileParameters = from.profileParameters; + to.order = from.order; + to.product = from.product; + } + function addOptionsAndMetrics(result, arr) { + const options = arr[0]; + const metrics = arr[1]; + const hasOptions = !isEmpty(options); + const hasMetrics = !isEmpty(metrics); + if (!hasOptions && !hasMetrics) { + return result; + } + if (hasOptions) { + result.options = options; + } + if (hasMetrics) { + result.metrics = metrics; + } + return result; + } + function processOption(option) { + const { + type + } = option; + switch (type) { + case REDIRECT: + return resolve(createRedirectOption(option)); + case DYNAMIC: + return createHtmlOption(option); + case ACTIONS: + return resolve(createActionsOption(option)); + default: + return resolve(option); + } + } + function processOptions$1(options, predicate) { + if (!isArray$1(options)) { + return resolve([]); + } + if (isEmpty(options)) { + return resolve([]); + } + const validOptions = filter(predicate, options); + if (isEmpty(validOptions)) { + return resolve([]); + } + const optionsPromises = map(opt => processOption(opt), validOptions); + return all(optionsPromises).then(filterNotNil); + } + function processMetrics$2(metrics, predicate) { + if (!isArray$1(metrics)) { + return resolve([]); + } + if (isEmpty(metrics)) { + return resolve([]); + } + return resolve(filter(predicate, metrics)); + } + function processPageLoad(httpContext) { + const { + response + } = httpContext; + const { + execute + } = response; + if (!isObject(execute)) { + return resolve(null); + } + const { + pageLoad + } = execute; + if (!isObject(pageLoad)) { + return resolve(null); + } + const { + analytics, + options, + metrics + } = pageLoad; + const result = { + analytics + }; + return all([processOptions$1(options, isValidOption$1), processMetrics$2(metrics, isValidSelectorMetric)]).then(arr => addOptionsAndMetrics(result, arr)); + } + function processExecuteMbox(item) { + const { + name, + analytics, + options, + metrics + } = item; + const result = { + name, + analytics + }; + return all([processOptions$1(options, isValidOption$1), processMetrics$2(metrics, isValidMetric)]).then(arr => addOptionsAndMetrics(result, arr)); + } + function processExecuteMboxes(httpContext) { + const { + response + } = httpContext; + const { + execute + } = response; + if (!isObject(execute)) { + return resolve([]); + } + const { + mboxes + } = execute; + if (!isArray$1(mboxes) || isEmpty(mboxes)) { + return resolve([]); + } + const validMboxes = filter(isValidMbox, mboxes); + return all(map(processExecuteMbox, validMboxes)).then(filterNotNil); + } + function sameMbox(mbox, index, name) { + return mbox.index === index && mbox.name === name; + } + function getRequestMbox(request, index, name) { + const { + prefetch = {} + } = request; + const { + mboxes = [] + } = prefetch; + if (isEmpty(mboxes)) { + return null; + } + return first(filter(item => sameMbox(item, index, name), mboxes)); + } + function processPrefetchMbox(request, item) { + const { + index, + name, + state, + analytics, + options, + metrics + } = item; + const requestMbox = getRequestMbox(request, index, name); + const result = { + name, + state, + analytics + }; + if (!isNil(requestMbox)) { + addContextDetails(result, requestMbox); + } + return all([processOptions$1(options, isValidOptionEventToken), processMetrics$2(metrics, isValidMetric)]).then(arr => addOptionsAndMetrics(result, arr)); + } + function processPrefetchMboxes(httpContext) { + const { + request, + response + } = httpContext; + const { + prefetch + } = response; + if (!isObject(prefetch)) { + return resolve([]); + } + const { + mboxes + } = prefetch; + if (!isArray$1(mboxes) || isEmpty(mboxes)) { + return resolve([]); + } + const validMboxes = filter(isValidPrefetchMbox, mboxes); + const process = item => processPrefetchMbox(request, item); + return all(map(process, validMboxes)).then(filterNotNil); + } + function getRequestView(request) { + const { + prefetch = {} + } = request; + const { + views = [] + } = prefetch; + if (isEmpty(views)) { + return null; + } + return views[0]; + } + function processView(request, view) { + const { + name, + state, + analytics, + options, + metrics + } = view; + const requestView = getRequestView(request); + const result = { + name: name.toLowerCase(), + state, + analytics + }; + if (!isNil(requestView)) { + addContextDetails(result, requestView); + } + return all([processOptions$1(options, isValidOptionEventToken), processMetrics$2(metrics, isValidSelectorMetric)]).then(arr => addOptionsAndMetrics(result, arr)); + } + function processPrefetchViews(httpContext) { + const { + request, + response + } = httpContext; + const { + prefetch + } = response; + if (!isObject(prefetch)) { + return resolve([]); + } + const { + views + } = prefetch; + if (!isArray$1(views) || isEmpty(views)) { + return resolve([]); + } + const validViews = filter(isValidView, views); + const process = view => processView(request, view); + return all(map(process, validViews)).then(filterNotNil); + } + function processPrefetchMetrics(httpContext) { + const { + response + } = httpContext; + const { + prefetch + } = response; + if (!isObject(prefetch)) { + return resolve([]); + } + const { + metrics + } = prefetch; + return processMetrics$2(metrics, isValidSelectorMetric); + } + function processMeta(httpContext) { + const { + response + } = httpContext; + const { + remoteMboxes, + remoteViews, + decisioningMethod + } = response; + const meta = {}; + if (isObject(remoteMboxes)) { + meta.remoteMboxes = remoteMboxes; + } + if (isObject(remoteViews)) { + meta.remoteViews = remoteViews; + } + if (isString(decisioningMethod)) { + meta.decisioningMethod = decisioningMethod; + } + return resolve(meta); + } + function processNotification(notification) { + if (isNil(notification) || isBlank(notification.id)) { + return resolve(null); + } + const { + id + } = notification; + return resolve({ + id + }); + } + function processNotifications(httpContext) { + const { + response + } = httpContext; + const { + notifications + } = response; + if (!isArray$1(notifications)) { + return resolve([]); + } + return all(map(processNotification, notifications)).then(filterNotNil); + } + function createResponseContext(arr) { + const pageLoad = arr[0]; + const mboxes = arr[1]; + const prefetchMboxes = arr[2]; + const views = arr[3]; + const prefetchMetrics = arr[4]; + const meta = arr[5]; + const notifications = arr[6]; + const result = {}; + const execute = {}; + if (isObject(pageLoad)) { + execute.pageLoad = pageLoad; + } + if (!isEmpty(mboxes)) { + execute.mboxes = mboxes; + } + const prefetch = {}; + if (!isEmpty(prefetchMboxes)) { + prefetch.mboxes = prefetchMboxes; + } + if (!isEmpty(views)) { + prefetch.views = views; + } + if (!isEmpty(prefetchMetrics)) { + prefetch.metrics = prefetchMetrics; + } + if (!isEmpty(execute)) { + result.execute = execute; + } + if (!isEmpty(prefetch)) { + result.prefetch = prefetch; + } + if (!isEmpty(meta)) { + result.meta = meta; + } + if (!isEmpty(notifications)) { + result.notifications = notifications; + } + return result; + } + function processResponse(httpContext) { + const handlers = [handleTraces, handleDeviceId, handleEdgeCluster]; + const context = flow(handlers)(httpContext); + const pageLoad = processPageLoad(context); + const mboxes = processExecuteMboxes(context); + const prefetchMboxes = processPrefetchMboxes(context); + const views = processPrefetchViews(context); + const prefetchMetrics = processPrefetchMetrics(context); + const meta = processMeta(context); + const notifications = processNotifications(context); + const promises = [pageLoad, mboxes, prefetchMboxes, views, prefetchMetrics, meta, notifications]; + return all(promises).then(createResponseContext); + } + + function hasRedirect(response) { + const redirect = getRedirect(response); + return !isEmpty(redirect); + } + function createEventPayload(response) { + const responseTokens = getResponseTokens(response); + const payload = {}; + if (!isEmpty(responseTokens)) { + payload.responseTokens = responseTokens; + } + return payload; + } + + function handleRequestSuccess$1(response) { + const payload = createEventPayload(response); + const analyticsDetails = getAnalyticsDetails(response); + if (!isEmpty(analyticsDetails)) { + payload.analyticsDetails = analyticsDetails; + } + logDebug(REQUEST_SUCCEEDED$1, response); + notifyRequestSucceeded(payload, hasRedirect(response)); + return resolve(response); + } + function handleMboxRequestSuccess(mbox, response) { + const payload = createEventPayload(response); + payload.mbox = mbox; + logDebug(REQUEST_SUCCEEDED$1, response); + notifyRequestSucceeded(payload, hasRedirect(response)); + return resolve(response); + } + function handleRequestError$1(error) { + logWarn(REQUEST_FAILED$1, error); + notifyRequestFailed({ + error + }); + return reject(error); + } + function handleMboxRequestError(mbox, error) { + logWarn(REQUEST_FAILED$1, error); + notifyRequestFailed({ + mbox, + error + }); + return reject(error); + } + function executeGetOffer(options) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const { + mbox, + timeout + } = options; + const params = isObject(options.params) ? options.params : {}; + const successFunc = response => handleMboxRequestSuccess(mbox, response); + const errorFunc = error => handleMboxRequestError(mbox, error); + const payload = {}; + const execute = {}; + if (mbox === globalMbox) { + execute.pageLoad = {}; + } else { + execute.mboxes = [{ + index: 0, + name: mbox + }]; + } + payload.execute = execute; + const analytics = createAnalytics$1(mbox, payload); + if (!isEmpty(analytics)) { + const experienceCloud = {}; + experienceCloud.analytics = analytics; + payload.experienceCloud = experienceCloud; + } + notifyRequestStart({ + mbox + }); + return createAsyncDeliveryRequest$1(payload, params).then(request => executeRequest(options, request, timeout)).then(processResponse).then(successFunc)['catch'](errorFunc); + } + function executeGetOffers(options) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const { + consumerId = globalMbox, + request, + timeout + } = options; + const analytics = createAnalytics$1(consumerId, request); + const successFunc = response => handleRequestSuccess$1(response); + const errorFunc = error => handleRequestError$1(error); + if (!isEmpty(analytics)) { + const experienceCloud = request.experienceCloud || {}; + experienceCloud.analytics = analytics; + request.experienceCloud = experienceCloud; + } + notifyRequestStart({}); + function measurePerf(response) { + return resolve(response); + } + return createAsyncDeliveryRequest$1(request, {}).then(deliveryRequest => executeRequest(options, deliveryRequest, timeout)).then(processResponse).then(measurePerf).then(successFunc)['catch'](errorFunc); + } + + function addClass(cssClass, selector) { + return select(selector).addClass(cssClass); + } + function setCss(style, selector) { + return select(selector).css(style); + } + + function getAttr(name, selector) { + return select(selector).attr(name); + } + function setAttr(name, value, selector) { + return select(selector).attr(name, value); + } + function removeAttr(name, selector) { + return select(selector).removeAttr(name); + } + function copyAttr(from, to, selector) { + const value = getAttr(from, selector); + if (isNotBlank(value)) { + removeAttr(from, selector); + setAttr(to, value, selector); + } + } + function hasAttr(name, selector) { + return isNotBlank(getAttr(name, selector)); + } + + const VISIBILITY_STATE = "visibilityState"; + const VISIBLE = "visible"; + const DELAY = 100; + function createError(selector) { + return new Error("Could not find: " + selector); + } + function awaitUsingMutationObserver(selector, timeout, queryFunc) { + return create$1((res, rej) => { + const mo = getMutationObserver(() => { + const elems = queryFunc(selector); + if (!isEmpty(elems)) { + mo.disconnect(); + res(elems); } - if (jsonLogic.is_logic(pattern)) { - if (jsonLogic.is_logic(rule)) { - var pattern_op = jsonLogic.get_operator(pattern); - var rule_op = jsonLogic.get_operator(rule); - if (pattern_op === "@" || pattern_op === rule_op) { - return jsonLogic.rule_like(jsonLogic.get_values(rule, false), jsonLogic.get_values(pattern, false)); - } - } - return false; + }); + delay(() => { + mo.disconnect(); + rej(createError(selector)); + }, timeout); + mo.observe(document$1, { + childList: true, + subtree: true + }); + }); + } + function canUseRequestAnimation() { + return document$1[VISIBILITY_STATE] === VISIBLE; + } + function awaitUsingRequestAnimation(selector, timeout, queryFunc) { + return create$1((res, rej) => { + function execute() { + const elems = queryFunc(selector); + if (!isEmpty(elems)) { + res(elems); + return; } - if (Array.isArray(pattern)) { - if (Array.isArray(rule)) { - if (pattern.length !== rule.length) { - return false; - } - for (var i = 0; i < pattern.length; i += 1) { - if (!jsonLogic.rule_like(rule[i], pattern[i])) { - return false; - } - } - return true; - } else { - return false; - } + window$1.requestAnimationFrame(execute); + } + execute(); + delay(() => { + rej(createError(selector)); + }, timeout); + }); + } + function awaitUsingTimer(selector, timeout, queryFunc) { + return create$1((res, rej) => { + function execute() { + const elems = queryFunc(selector); + if (!isEmpty(elems)) { + res(elems); + return; } - return false; - }; - return jsonLogic; + delay(execute, DELAY); + } + execute(); + delay(() => { + rej(createError(selector)); + }, timeout); + }); + } + function awaitSelector(selector) { + let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getConfig()[SELECTORS_POLLING_TIMEOUT]; + let queryFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : select; + const elems = queryFunc(selector); + if (!isEmpty(elems)) { + return resolve(elems); + } + if (canUseMutationObserver()) { + return awaitUsingMutationObserver(selector, timeout, queryFunc); + } + if (canUseRequestAnimation()) { + return awaitUsingRequestAnimation(selector, timeout, queryFunc); + } + return awaitUsingTimer(selector, timeout, queryFunc); + } + + function getDataSrc(item) { + return getAttr(DATA_SRC, item); + } + function hasDataSrc(item) { + return hasAttr(DATA_SRC, item); + } + function disableImages(html) { + forEach(item => copyAttr(SRC, DATA_SRC, item), toArray(find(IMAGE_TAG, html))); + return html; + } + function enableImages(html) { + forEach(item => copyAttr(DATA_SRC, SRC, item), toArray(find(IMAGE_TAG, html))); + return html; + } + function loadImage(src) { + logDebug(LOADING_IMAGE, src); + return getAttr(SRC, setAttr(SRC, src, wrap("<" + IMAGE_TAG + "/>"))); + } + function loadImages(html) { + const elements = filter(hasDataSrc, toArray(find(IMAGE_TAG, html))); + if (isEmpty(elements)) { + return html; + } + forEach(loadImage, map(getDataSrc, elements)); + return html; + } + function renderImages(html) { + return flow([disableImages, loadImages, enableImages])(html); + } + + function getUrl(item) { + const src = getAttr(SRC, item); + return isNotBlank(src) ? src : null; + } + function getScriptsUrls(html) { + return filter(isNotBlank, map(getUrl, toArray(find(SCRIPT, html)))); + } + function loadScripts(urls) { + return reduce((acc, url) => acc.then(() => { + logDebug(REMOTE_SCRIPT, url); + addClientTrace({ + remoteScript: url + }); + return reactorLoadScript(url); + }), resolve(), urls); + } + + function handleRenderingSuccess$1(action) { + return action; + } + function handleRenderingError$1(action, error) { + logWarn(UNEXPECTED_ERROR, error); + addClientTrace({ + action, + error + }); + return action; + } + function renderHtml(renderFunc, action) { + const container = select(action[SELECTOR]); + const html = renderImages(fragment(action[CONTENT])); + const urls = getScriptsUrls(html); + let result; + try { + result = resolve(renderFunc(container, html)); + } catch (err) { + return reject(handleRenderingError$1(action, err)); + } + if (isEmpty(urls)) { + return result.then(() => handleRenderingSuccess$1(action))['catch'](error => handleRenderingError$1(action, error)); + } + return result.then(() => loadScripts(urls)).then(() => handleRenderingSuccess$1(action))['catch'](error => handleRenderingError$1(action, error)); + } + + const HEAD_TAGS_SELECTOR = SCRIPT_TAG + "," + LINK_TAG + "," + STYLE_TAG; + function getHeadContent(content) { + const container = fragment(content); + const result = reduce((acc, elem) => { + acc.push(getHtml(fragment(elem))); + return acc; + }, [], toArray(find(HEAD_TAGS_SELECTOR, container))); + return join("", result); + } + function preprocessAction(action) { + const result = reactorObjectAssign({}, action); + const content = result[CONTENT]; + if (isBlank(content)) { + return result; + } + const container = select(result[SELECTOR]); + if (!is(HEAD_TAG, container)) { + return result; + } + result[TYPE] = APPEND_HTML; + result[CONTENT] = getHeadContent(content); + return result; + } + function addPxIfRequired(value) { + const hasPx = value.indexOf("px") === value.length - 2; + return hasPx ? value : value + "px"; + } + function setHtmlRenderFunc(container, html) { + return setHtml$3(getHtml(html), container); + } + function setHtml$1(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(setHtmlRenderFunc, action); + } + function setText$2(action) { + const container = select(action[SELECTOR]); + const content = action[CONTENT]; + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + setText$4(content, container); + return resolve(action); + } + function appendHtmlRenderFunc(container, html) { + return append(getHtml(html), container); + } + function appendHtml$1(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(appendHtmlRenderFunc, action); + } + function prependHtmlRenderFunc(container, html) { + return prepend(getHtml(html), container); + } + function prependHtml$1(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(prependHtmlRenderFunc, action); + } + function replaceHtmlRenderFunc(container, html) { + const parentContainer = parent(container); + remove$4(before(getHtml(html), container)); + return parentContainer; + } + function replaceHtml$1(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(replaceHtmlRenderFunc, action); + } + function insertBeforeRenderFunc(container, html) { + return prev(before(getHtml(html), container)); + } + function insertBefore$2(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(insertBeforeRenderFunc, action); + } + function insertAfterRenderFunc(container, html) { + return next(after(getHtml(html), container)); + } + function insertAfter$2(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(insertAfterRenderFunc, action); + } + function customCodeRenderFunc(container, html) { + return parent(before(getHtml(html), container)); + } + function customCode$2(action) { + logDebug(ACTION_RENDERING, action); + return renderHtml(customCodeRenderFunc, action); + } + function setImageSource$1(action) { + const content = action[CONTENT]; + const container = select(action[SELECTOR]); + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + removeAttr(SRC, container); + setAttr(SRC, loadImage(content), container); + return resolve(action); + } + function setAttribute$2(action) { + const content = action[CONTENT]; + const container = select(action[SELECTOR]); + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + forEach((value, key) => setAttr(key, value, container), content); + return resolve(action); + } + function setCssWithPriority(container, style, priority) { + forEach(elem => { + forEach((value, key) => elem.style.setProperty(key, value, priority), style); + }, toArray(container)); + } + function setStyle$2(action) { + const container = select(action[SELECTOR]); + const content = action[CONTENT]; + const priority = content[PRIORITY]; + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + if (isBlank(priority)) { + setCss(content, container); + } else { + setCssWithPriority(container, content, priority); + } + return resolve(action); + } + function resize$1(action) { + const container = select(action[SELECTOR]); + const content = action[CONTENT]; + content[WIDTH] = addPxIfRequired(content[WIDTH]); + content[HEIGHT] = addPxIfRequired(content[HEIGHT]); + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + setCss(content, container); + return resolve(action); + } + function move$1(action) { + const container = select(action[SELECTOR]); + const content = action[CONTENT]; + content[LEFT] = addPxIfRequired(content[LEFT]); + content[TOP] = addPxIfRequired(content[TOP]); + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + setCss(content, container); + return resolve(action); + } + function remove$2(action) { + const container = select(action[SELECTOR]); + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + remove$4(container); + return resolve(action); + } + function rearrange$2(action) { + const container = select(action[SELECTOR]); + const content = action[CONTENT]; + const from = Number(content[FROM]); + const to = Number(content[TO]); + if (isNaN(from) && isNaN(to)) { + logDebug(REARRANGE_INCORRECT_INDEXES, action); + return reject(action); + } + const elements = toArray(children(container)); + const elemFrom = elements[from]; + const elemTo = elements[to]; + if (!exists(elemFrom) || !exists(elemTo)) { + logDebug(REARRANGE_MISSING, action); + return reject(action); + } + logDebug(ACTION_RENDERING, action); + addClientTrace({ + action + }); + if (from < to) { + after(elemFrom, elemTo); + } else { + before(elemFrom, elemTo); + } + return resolve(action); + } + function executeRenderAction(action) { + const processedAction = preprocessAction(action); + const type = processedAction[TYPE]; + switch (type) { + case SET_HTML: + return setHtml$1(processedAction); + case SET_TEXT: + return setText$2(processedAction); + case APPEND_HTML: + return appendHtml$1(processedAction); + case PREPEND_HTML: + return prependHtml$1(processedAction); + case REPLACE_HTML: + return replaceHtml$1(processedAction); + case INSERT_BEFORE: + return insertBefore$2(processedAction); + case INSERT_AFTER: + return insertAfter$2(processedAction); + case CUSTOM_CODE: + return customCode$2(processedAction); + case SET_ATTRIBUTE: + return setAttribute$2(processedAction); + case SET_IMAGE_SOURCE: + return setImageSource$1(processedAction); + case SET_STYLE: + return setStyle$2(processedAction); + case RESIZE: + return resize$1(processedAction); + case MOVE: + return move$1(processedAction); + case REMOVE: + return remove$2(processedAction); + case REARRANGE: + return rearrange$2(processedAction); + default: + return resolve(processedAction); + } + } + + const ACTION_KEY_ATTR = "at-action-key"; + function isClickTracking(action) { + return action[TYPE] === TRACK_CLICK || action[TYPE] === SIGNAL_CLICK; + } + function hasValidSelector(action) { + const selector = action[SELECTOR]; + return isNotBlank(selector) || isElement(selector); + } + function markAsRendered(action) { + const { + key + } = action; + if (isBlank(key)) { + return; + } + if (!hasValidSelector(action)) { + return; + } + const selector = action[SELECTOR]; + setAttr(ACTION_KEY_ATTR, key, selector); + } + function removeActionCssHiding(action) { + const cssSelector = action[CSS_SELECTOR]; + if (isBlank(cssSelector)) { + return; + } + removeActionHidingStyle(cssSelector); + } + function displayAction(action) { + if (!hasValidSelector(action)) { + removeActionCssHiding(action); + return; + } + const selector = action[SELECTOR]; + if (isClickTracking(action)) { + addClass(CLICK_TRACKING_CSS_CLASS, selector); + return; + } + addClass(MARKER_CSS_CLASS, selector); + removeActionCssHiding(action); + } + function displayActions(actions) { + forEach(displayAction, actions); + } + function shouldRender(action) { + const { + key + } = action; + if (isBlank(key)) { + return true; + } + const type = action[TYPE]; + if (type === CUSTOM_CODE) { + return action[PAGE]; + } + const selector = action[SELECTOR]; + const currentKey = getAttr(ACTION_KEY_ATTR, selector); + if (currentKey !== key) { + return true; + } + if (currentKey === key) { + return !action[PAGE]; + } + return false; + } + function renderAwaitedAction(action) { + if (!shouldRender(action)) { + displayAction(action); + return action; + } + return executeRenderAction(action).then(() => { + logDebug(ACTION_RENDERED, action); + addClientTrace({ + action + }); + markAsRendered(action); + displayAction(action); + return action; + })['catch'](error => { + logWarn(UNEXPECTED_ERROR, error); + addClientTrace({ + action, + error + }); + displayAction(action); + const result = reactorObjectAssign({}, action); + result[ERROR] = true; + return result; }); - }); - - const TOTAL_BUCKETS = 10000; - const MAX_PERCENTAGE = 100; - function validTntId(tntId = "") { - if (isString(tntId) && !isEmpty(tntId)) { - const [id, locationHint] = tntId.split("."); - return id; - } - return undefined; } - function getOrCreateVisitorId(visitorId) { - if (visitorId) { - return visitorId.marketingCloudVisitorId || validTntId(visitorId.tntId) || visitorId.thirdPartyId || uuid() - ; + function postProcess(actions) { + const errorActions = filter(e => e[ERROR] === true, actions); + if (isEmpty(errorActions)) { + return resolve(); } - return uuid(); + displayActions(errorActions); + return reject(actions); } - function calculateAllocation(deviceId) { - const signedNumericHashValue = hashUnencodedChars(deviceId); - const hashFixedBucket = Math.abs(signedNumericHashValue) % TOTAL_BUCKETS; - const allocationValue = hashFixedBucket / TOTAL_BUCKETS * MAX_PERCENTAGE; - return Math.round(allocationValue * 100) / 100; + function awaitAction(action) { + const selector = action[SELECTOR]; + return awaitSelector(selector).then(() => action)['catch'](() => { + const result = reactorObjectAssign({}, action); + result[ERROR] = true; + return result; + }); } - const calculateAllocationMemoized = memoize(calculateAllocation); - function computeAllocation(clientId, activityId, visitorId, salt = CAMPAIGN_BUCKET_SALT) { - const deviceId = [clientId, activityId, isString(visitorId) && !isEmpty(visitorId) ? visitorId : getOrCreateVisitorId(visitorId), salt].join("."); - return calculateAllocationMemoized(deviceId); + function awaitAndRenderAction(action) { + return awaitAction(action).then(renderAwaitedAction); } - - function ruleEvaluator(clientId, visitorId) { - const visitorIdString = getOrCreateVisitorId(visitorId); - return function processRule(rule, context, requestType, requestDetail, postProcessors, tracer) { - let consequence; - let { - page, - referring - } = context; - if (isDefined(requestDetail.address)) { - page = createPageContext(requestDetail.address) || page; - referring = createPageContext(requestDetail.address) || referring; - } - const ruleContext = _objectSpread2(_objectSpread2({}, context), {}, { - page, - referring, - mbox: createMboxContext(requestDetail), - allocation: computeAllocation(clientId, rule.meta[ACTIVITY_ID], visitorIdString) - }); - const ruleSatisfied = logic.apply(rule.condition, ruleContext); - tracer.traceRuleEvaluated(rule, requestDetail, requestType, ruleContext, ruleSatisfied); - if (ruleSatisfied) { - consequence = _objectSpread2(_objectSpread2({}, rule.consequence), {}, { - index: requestDetail.index - }); - postProcessors.forEach(postProcessFunc => { - consequence = postProcessFunc(rule, consequence, requestType, requestDetail, tracer); - }); - } - return cloneDeep(consequence); - }; + function executeRenderActions(actions) { + const promises = map(awaitAndRenderAction, actions); + return all(promises).then(postProcess); } - function byPropertyToken(propertyToken) { - function filter(rule) { - const { - propertyTokens = [] - } = rule; - return isUndefined(propertyToken) ? propertyTokens.length === 0 : propertyTokens.length === 0 || includes(propertyToken, propertyTokens); - } - return filter; + function addEventListener(type, func, selector) { + return select(selector).on(type, func); + } + function removeEventListener(type, func, selector) { + return select(selector).off(type, func); } - const TIMING_GET_OFFER = "get_offer"; - const TIMING_ARTIFACT_DOWNLOADED_TOTAL = "artifactDownloaded_total"; - const TIMING_ARTIFACT_DOWNLOADED_FETCH = "artifactDownloaded_fetch"; - const TIMING_ARTIFACT_GET_INITIAL = "artifactGetInitial"; - const TIMING_ARTIFACT_READ_JSON = "artifactDownloaded_read_JSON"; - const TIMING_ARTIFACT_DEOBFUSCATE = "deobfuscate_total"; - - const LOG_TAG$1 = LOG_PREFIX$1 + ".DecisionProvider"; - const PARTIAL_CONTENT = 206; - const OK = 200; - function DecisionProvider(config, targetOptions, context, artifact, logger, traceProvider) { - const timingTool = createPerfToolInstance(); - timingTool.timeStart(TIMING_GET_OFFER); - const { - responseTokens, - rules - } = artifact; - const globalMboxName = artifact.globalMbox || DEFAULT_GLOBAL_MBOX; - const clientId = config.client; - const { - request, - visitor - } = targetOptions; - const propertyToken = getPropertyToken(request.property); - const { - sendNotificationFunc, - telemetryEnabled = true - } = config; - const visitorId = request.id; - const processRule = ruleEvaluator(clientId, visitorId); - const dependency = hasRemoteDependency(artifact, request); - const notificationProvider = NotificationProvider(request, visitor, logger, sendNotificationFunc, telemetryEnabled); - function getDecisions(mode, postProcessors) { - if (isUndefined(request[mode])) { - return undefined; - } - const requestTracer = RequestTracer(traceProvider, artifact); - function processViewRequest(requestDetails, additionalPostProcessors = []) { - requestTracer.traceRequest(mode, RequestType.VIEW, requestDetails, context); - const consequences = {}; - let viewRules = []; - if (Object.prototype.hasOwnProperty.call(requestDetails, "name") && isDefined(requestDetails.name)) { - viewRules = rules.views[requestDetails.name] || []; - } else { - viewRules = Object.keys(rules.views).reduce((result, key) => [...result, ...rules.views[key]], []); - } - viewRules = viewRules.filter(byPropertyToken(propertyToken)); - const matchedRuleKeys = new Set(); - for (const rule of viewRules) { - const ruleKey = getRuleKey(rule); - let consequence; - if (!matchedRuleKeys.has(ruleKey)) { - consequence = processRule(rule, context, RequestType.VIEW, requestDetails, [...postProcessors, ...additionalPostProcessors], requestTracer); - } - if (consequence) { - matchedRuleKeys.add(ruleKey); - if (!consequences[consequence.name]) { - consequences[consequence.name] = consequence; - } else { - consequences[consequence.name] = _objectSpread2(_objectSpread2({}, consequences[consequence.name]), {}, { - options: [...consequences[consequence.name].options, ...consequence.options], - metrics: [...consequences[consequence.name].metrics, ...consequence.metrics] - }); - } - } - } - return values(consequences); - } - function processMboxRequest(mboxRequest, additionalPostProcessors = []) { - const isGlobalMbox = mboxRequest.name === globalMboxName; - requestTracer.traceRequest(mode, RequestType.MBOX, mboxRequest, context); - const consequences = []; - const mboxRules = (rules.mboxes[mboxRequest.name] || []).filter(byPropertyToken(propertyToken)); - const matchedRuleKeys = new Set(); - for (const rule of mboxRules) { - const ruleKey = getRuleKey(rule); - let consequence; - if (!isGlobalMbox || isGlobalMbox && !matchedRuleKeys.has(ruleKey)) { - consequence = processRule(rule, context, RequestType.MBOX, mboxRequest, [...postProcessors, ...additionalPostProcessors], requestTracer); - } - if (consequence) { - consequences.push(consequence); - matchedRuleKeys.add(ruleKey); - if (!isGlobalMbox) { - break; - } - } - } - if (!isGlobalMbox && consequences.length === 0) { - consequences.push({ - name: mboxRequest.name, - index: mboxRequest.index, - trace: requestTracer.getTraceResult() - }); - } - return consequences; - } - function processPageLoadRequest(requestDetails) { - let trace; - const consequences = processMboxRequest(_objectSpread2(_objectSpread2({}, requestDetails), {}, { - name: globalMboxName - }), [function preserveTrace(rule, mboxResponse) { - trace = mboxResponse.trace; - return mboxResponse; - }, removePageLoadAttributes]); - const options = flatten(consequences.map(consequence => consequence.options)); - const result = { - options, - trace - }; - const indexedMetrics = consequences.reduce((indexed, consequence) => { - if (consequence.metrics instanceof Array) { - consequence.metrics.forEach(metric => { - indexed[metric.eventToken] = metric; - }); - } - return indexed; - }, {}); - const metrics = values(indexedMetrics); - if (metrics.length > 0) { - result.metrics = metrics; - } - return result; - } - const response = {}; - if (request[mode].mboxes) { - response.mboxes = flatten(request[mode].mboxes.map(mboxRequest => processMboxRequest(mboxRequest))); - } - if (request[mode].views) { - response.views = flatten(request[mode].views.map(requestDetails => processViewRequest(requestDetails))); - } - if (request[mode].pageLoad) { - response.pageLoad = processPageLoadRequest(request[mode].pageLoad); - } - return response; - } - function getExecuteDecisions(postProcessors) { - return getDecisions("execute", [function prepareNotification(rule, mboxResponse, requestType, requestDetail, tracer) { - notificationProvider.addNotification(mboxResponse, tracer.traceNotification(rule)); - return mboxResponse; - }, prepareExecuteResponse, ...postProcessors]); - } - function getPrefetchDecisions(postProcessors) { - return getDecisions("prefetch", [preparePrefetchResponse, ...postProcessors]); - } - const addResponseTokens = createResponseTokensPostProcessor(context, responseTokens); - const commonPostProcessor = [addResponseTokens, replaceCampaignMacros, addTrace, cleanUp]; - const response = objectWithoutUndefinedValues({ - status: dependency.remoteNeeded ? PARTIAL_CONTENT : OK, - remoteMboxes: dependency.remoteMboxes, - remoteViews: dependency.remoteViews, - requestId: request.requestId, - id: _objectSpread2({}, request.id), - client: clientId, - edgeHost: undefined, - execute: getExecuteDecisions(commonPostProcessor), - prefetch: getPrefetchDecisions(commonPostProcessor) - }); - notificationProvider.addTelemetryEntry({ - execution: timingTool.timeEnd(TIMING_GET_OFFER) - }); - notificationProvider.sendNotifications(); - logger.debug("" + LOG_TAG$1, request, response); - return Promise.resolve(response); + const METRIC_ELEMENT_NOT_FOUND = "metric element not found"; + function executeMetric(metric) { + const selector = metric[SELECTOR]; + return awaitSelector(selector).then(() => { + addClientTrace({ + metric + }); + const foundMetric = reactorObjectAssign({ + found: true + }, metric); + return foundMetric; + })['catch'](() => { + logWarn(METRIC_ELEMENT_NOT_FOUND, metric); + addClientTrace({ + metric, + message: METRIC_ELEMENT_NOT_FOUND + }); + return metric; + }); } - const GEO_MAPPINGS = [{ - headerName: HTTP_HEADER_FORWARDED_FOR, - parseValue: value => value, - valueKey: "ipAddress" - }, { - headerName: HTTP_HEADER_GEO_LATITUDE, - parseValue: value => parseFloat(value), - valueKey: "latitude" - }, { - headerName: HTTP_HEADER_GEO_LONGITUDE, - parseValue: value => parseFloat(value), - valueKey: "longitude" - }, { - headerName: HTTP_HEADER_GEO_COUNTRY, - parseValue: value => value, - valueKey: "countryCode" - }, { - headerName: HTTP_HEADER_GEO_REGION, - parseValue: value => value, - valueKey: "stateCode" - }, { - headerName: HTTP_HEADER_GEO_CITY, - parseValue: value => value, - valueKey: "city" - }]; - function mapGeoValues(valueFn, initial = {}) { - return GEO_MAPPINGS.reduce((result, mapping) => { - const value = valueFn.call(null, mapping.headerName); - if (value != null && isDefined(value)) { - result[mapping.valueKey] = mapping.parseValue(value); - } - return result; - }, initial); + const notEmpty = val => !isEmpty(val); + function throwIfOptout(values) { + const optout = values[MCOPTOUT]; + if (optout) { + throw new Error(OPTOUT_MESSAGE); + } + return values; } - function createGeoObjectFromHeaders(geoHeaders) { - return mapGeoValues(key => geoHeaders.get(key)); + function getAsyncThirdPartyData() { + const visitorValues = getAsyncVisitorValues(); + const dataProvidersParams = getAsyncDataProvidersParameters(); + return all([visitorValues.then(throwIfOptout), dataProvidersParams]); } - function createGeoObjectFromPayload(geoPayload = {}) { - return mapGeoValues(key => geoPayload[key]); + function getSyncThirdPartyData() { + const visitorValues = getSyncVisitorValues(); + const dataProvidersParams = getSyncDataProvidersParameters(); + return [visitorValues, dataProvidersParams]; } - function GeoProvider(config, artifact) { - const fetchApi = getFetchApi(config.fetchApi); + function getAllParams(providersParams) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + return reactorObjectAssign({}, providersParams, getTargetPageParams(globalMbox)); + } + function getTimeOffset() { + return -new Date().getTimezoneOffset(); + } + function createScreen() { const { - geoTargetingEnabled = false - } = artifact; + screen + } = window$1; + return { + width: screen.width, + height: screen.height, + orientation: getScreenOrientation(), + colorDepth: screen.colorDepth, + pixelRatio: getPixelRatio() + }; + } + function createWindow() { const { - eventEmitter = noop - } = config; - function validGeoRequestContext(geoRequestContext = {}) { - const validatedGeoRequestContext = _objectSpread2({}, geoRequestContext); - if (geoRequestContext.ipAddress === UNKNOWN_IP_ADDRESS || !isValidIpAddress(geoRequestContext.ipAddress)) { - delete validatedGeoRequestContext.ipAddress; - } - const geoLookupPath = getGeoLookupPath(config); - if (geoTargetingEnabled && (geoRequestContext.ipAddress === UNKNOWN_IP_ADDRESS || isValidIpAddress(geoRequestContext.ipAddress)) && isUndefined(geoRequestContext.latitude) && isUndefined(geoRequestContext.longitude) && isUndefined(geoRequestContext.countryCode) && isUndefined(geoRequestContext.stateCode) && isUndefined(geoRequestContext.city)) { - const headers = {}; - if (geoRequestContext.ipAddress !== UNKNOWN_IP_ADDRESS) { - headers[HTTP_HEADER_FORWARDED_FOR] = geoRequestContext.ipAddress; - } - return fetchApi(geoLookupPath, { - headers - }).then(geoResponse => geoResponse.json().then(geoPayload => createGeoObjectFromPayload(geoPayload))).then(fetchedGeoValues => { - reactorObjectAssign(validatedGeoRequestContext, fetchedGeoValues); - eventEmitter(GEO_LOCATION_UPDATED, { - geoContext: validatedGeoRequestContext - }); - return validatedGeoRequestContext; - }); - } - return Promise.resolve(validatedGeoRequestContext); - } - return validGeoRequestContext; + documentElement + } = document$1; + return { + width: documentElement.clientWidth, + height: documentElement.clientHeight + }; } - - const HEADER_BOUNDARY = 40; - function ObfuscationProvider(config) { + function createBrowser() { const { - organizationId - } = config; - const decoder = new TextDecoder("utf-8"); - function getHeader(buffer) { - const dataView = new DataView(buffer); - const text = decoder.decode(dataView); - const [prefix, version] = text.slice(0, 8).split(":"); - const key = text.slice(8, 41); - return { - prefix, - version: parseInt(version, 10), - key - }; - } - function getArtifact(key, obfuscatedArtifactBuffer) { - let deobfuscatedArtifactJSON = {}; - const keyBuffer = new TextEncoder().encode([organizationId, key].join("")); - const keyView = new DataView(keyBuffer.buffer); - const keyLength = keyView.byteLength; - const obfuscatedArtifactView = new DataView(obfuscatedArtifactBuffer); - const artifactLength = obfuscatedArtifactView.byteLength; - const deobfuscatedArtifactView = new DataView(new ArrayBuffer(artifactLength)); - for (let i = 0; i < artifactLength; i += 1) { - deobfuscatedArtifactView.setInt8(i, obfuscatedArtifactView.getInt8(i) ^ keyView.getInt8(i % keyLength)); - } - const deobfuscatedArtifactString = decoder.decode(deobfuscatedArtifactView); - try { - deobfuscatedArtifactJSON = JSON.parse(deobfuscatedArtifactString); - } catch (err) { - throw new Error(Messages.ARTIFACT_OBFUSCATION_ERROR); - } - return deobfuscatedArtifactJSON; - } - function deobfuscate(buffer) { - const header = getHeader(buffer.slice(0, HEADER_BOUNDARY)); - if (header.version !== SUPPORTED_ARTIFACT_OBFUSCATION_VERSION) { - throw new Error(Messages.ARTIFACT_INVALID); - } - return getArtifact(header.key, buffer.slice(HEADER_BOUNDARY)); - } + location + } = window$1; return { - deobfuscate + host: location.hostname, + webGLRenderer: getWebGLRenderer() }; } - - const LOG_TAG$2 = LOG_PREFIX$1 + ".ArtifactProvider"; - const NOT_MODIFIED$1 = 304; - const OK$1 = 200; - function ArtifactProvider(config) { - const logger = getLogger(config.logger); + function createAddress() { const { - eventEmitter = noop - } = config; - const obfuscationProvider = ObfuscationProvider(config); - function getPollingInterval() { - if ( - isNumber(config.pollingInterval) && config.pollingInterval === 0) { - return 0; - } - return Math.max(MINIMUM_POLLING_INTERVAL, isNumber(config.pollingInterval) ? config.pollingInterval : DEFAULT_POLLING_INTERVAL); - } - const pollingInterval = getPollingInterval(); - const fetchApi = getFetchApi(config.fetchApi); - let pollingHalted = false; - let pollingTimer; - let artifact; - const subscriptions = {}; - let subscriptionCount = 0; - let lastResponseEtag; - let lastResponseData; - const artifactLocation = determineArtifactLocation(config); - const artifactFormat = isString(config.artifactFormat) ? config.artifactFormat : determineArtifactFormat(artifactLocation); - const fetchWithRetry = getFetchWithRetry(fetchApi, NUM_FETCH_RETRIES, errorMessage => Messages.ERROR_MAX_RETRY(NUM_FETCH_RETRIES, errorMessage), error => eventEmitter(ARTIFACT_DOWNLOAD_FAILED, { - artifactLocation, - error - })); - function emitNewArtifact(artifactPayload, geoContext = {}) { - eventEmitter(ARTIFACT_DOWNLOAD_SUCCEEDED, { - artifactLocation, - artifactPayload - }); - eventEmitter(GEO_LOCATION_UPDATED, { - geoContext - }); - values(subscriptions).forEach(subscriptionFunc => subscriptionFunc(artifactPayload)); + location + } = window$1; + return { + url: location.href, + referringUrl: document$1.referrer + }; + } + function createContext(context) { + if (!isNil(context) && context.channel === WEB_CHANNEL) { + return context; } - function deobfuscate(res) { - if (artifactFormat === ARTIFACT_FORMAT_BINARY) { - perfTool.timeStart(TIMING_ARTIFACT_DEOBFUSCATE); - return res.arrayBuffer().then(buffer => { - return obfuscationProvider.deobfuscate(buffer).then(deobfuscated => { - perfTool.timeEnd(TIMING_ARTIFACT_DEOBFUSCATE); - return deobfuscated; - }); - }); - } - perfTool.timeStart(TIMING_ARTIFACT_READ_JSON); - return res.json().then(data => { - perfTool.timeEnd(TIMING_ARTIFACT_READ_JSON); - return data; - }); + const validContext = context || {}; + const { + beacon + } = validContext; + return { + userAgent: window$1.navigator.userAgent, + timeOffsetInMinutes: getTimeOffset(), + channel: WEB_CHANNEL, + screen: createScreen(), + window: createWindow(), + browser: createBrowser(), + address: createAddress(), + geo: context && context.geo, + beacon + }; + } + function createAudienceManager(audienceManager, visitorValues) { + if (!isNil(audienceManager)) { + return audienceManager; } - function fetchArtifact(artifactUrl) { - perfTool.timeStart(TIMING_ARTIFACT_DOWNLOADED_TOTAL); - const headers = {}; - logger.debug(LOG_TAG$2 + " fetching artifact - " + artifactUrl); - if (lastResponseEtag && !isBrowser() && isNodeJS()) { - headers["If-None-Match"] = lastResponseEtag; - } - perfTool.timeStart(TIMING_ARTIFACT_DOWNLOADED_FETCH); - return fetchWithRetry(artifactUrl, { - headers, - cache: "default" - }).then(res => { - perfTool.timeEnd(TIMING_ARTIFACT_DOWNLOADED_FETCH); - logger.debug(LOG_TAG$2 + " artifact received - status=" + res.status); - if (res.status === NOT_MODIFIED$1 && lastResponseData) { - return lastResponseData; - } - if (res.ok && res.status === OK$1) { - return deobfuscate(res).then(responseData => { - const etag = res.headers.get("Etag"); - if (etag != null && isDefined(etag)) { - lastResponseData = responseData; - lastResponseEtag = etag; - } - emitNewArtifact(responseData, createGeoObjectFromHeaders(res.headers)); - perfTool.timeEnd(TIMING_ARTIFACT_DOWNLOADED_TOTAL); - return responseData; - }); - } - return undefined; - })['catch'](err => { - const reason = err.message || err.toString(); - logger.error(Messages.ARTIFACT_FETCH_ERROR(reason)); - }); + const result = {}; + if (isEmpty(visitorValues)) { + return result; } - function addSubscription(callbackFunc) { - subscriptionCount += 1; - subscriptions[subscriptionCount] = callbackFunc; - return subscriptionCount; + const locationHint = visitorValues[MCAAMLH]; + const locationHintNumber = parseInt(locationHint, 10); + if (!isNaN(locationHintNumber)) { + result.locationHint = locationHintNumber; } - function removeSubscription(id) { - delete subscriptions[id]; + const blob = visitorValues[MCAAMB]; + if (isNotBlank(blob)) { + result.blob = blob; } - function scheduleNextUpdate() { - if (pollingInterval === 0 || pollingHalted) { - return; - } - pollingTimer = setTimeout(() => { - fetchArtifact(artifactLocation).then(newArtifact => { - artifact = newArtifact; - return newArtifact; - }); - scheduleNextUpdate(); - }, pollingInterval); + return result; + } + function createCustomerId(data) { + const { + id, + integrationCode, + authenticatedState, + type, + primary + } = data; + const result = {}; + if (isNotBlank(id)) { + result.id = id; } - function stopAllPolling() { - if (isDefined(pollingTimer)) { - clearTimeout(pollingTimer); - pollingTimer = undefined; - } - pollingHalted = true; + if (isNotBlank(integrationCode)) { + result.integrationCode = integrationCode; } - function resumePolling() { - pollingHalted = false; - scheduleNextUpdate(); + if (isNotBlank(authenticatedState)) { + result.authenticatedState = authenticatedState; } - function getArtifact() { - return artifact; + if (isNotBlank(type)) { + result.type = type; } - function getInitialArtifact() { - perfTool.timeStart(TIMING_ARTIFACT_GET_INITIAL); - return isObject(config.artifactPayload) ? Promise.resolve(config.artifactPayload) : fetchArtifact(artifactLocation); + if (primary) { + result.primary = primary; } - return getInitialArtifact().then(newArtifact => { - perfTool.timeEnd(TIMING_ARTIFACT_GET_INITIAL); - artifact = newArtifact; - const artifactTracer = ArtifactTracer(artifactLocation, config.artifactPayload, pollingInterval, pollingHalted, artifact); - addSubscription(value => artifactTracer.provideNewArtifact(value)); - return { - getArtifact: () => getArtifact(), - subscribe: callbackFunc => addSubscription(callbackFunc), - unsubscribe: id => removeSubscription(id), - stopPolling: () => stopAllPolling(), - resumePolling: () => resumePolling(), - getTrace: () => artifactTracer.toJSON() - }; - }).finally(() => { - scheduleNextUpdate(); - }); + return result; } - - function getCustomerId(visitorId) { - if (!visitorId.customerIds || !(visitorId.customerIds instanceof Array)) { - return undefined; + function createCustomerIds(customerIdsValues) { + return map(createCustomerId, customerIdsValues); + } + function createVisitorId(id, deviceId, thirdPartyId, visitorValues, customerIdsValues) { + const result = {}; + if (isNotBlank(deviceId)) { + result.tntId = deviceId; } - const customerIds = visitorId.customerIds.filter(customerId => customerId.authenticatedState === AuthenticatedState.Authenticated); - if (customerIds.length > 0) { - return customerIds[0].id; + if (isNotBlank(thirdPartyId)) { + result.thirdPartyId = thirdPartyId; } - return undefined; - } - function validVisitorId(visitorId, targetLocationHint) { - const result = _objectSpread2({}, visitorId); - if (!result.tntId && !result.marketingCloudVisitorId && !getCustomerId(result) && !result.thirdPartyId) { - const locationHint = isString(targetLocationHint) && !isBlank(targetLocationHint) ? "." + targetLocationHint + "_0" : ""; - result.tntId = "" + uuid() + locationHint; + if (isNotBlank(id.thirdPartyId)) { + result.thirdPartyId = id.thirdPartyId; + } + const mid = visitorValues[MCMID]; + if (isNotBlank(mid)) { + result.marketingCloudVisitorId = mid; + } + if (isNotBlank(id.marketingCloudVisitorId)) { + result.marketingCloudVisitorId = id.marketingCloudVisitorId; + } + if (!isEmpty(id.customerIds)) { + result.customerIds = id.customerIds; + return result; + } + if (!isEmpty(customerIdsValues)) { + result.customerIds = createCustomerIds(customerIdsValues); } return result; } - function validDeliveryRequest(request, targetLocationHint, validGeoRequestContext) { - const { - context = {} - } = request; - return validGeoRequestContext(context.geo || {}).then(geo => { - return _objectSpread2(_objectSpread2({}, request), {}, { - context: _objectSpread2(_objectSpread2({}, context), {}, { - geo - }), - id: validVisitorId(request.id, targetLocationHint), - requestId: request.requestId || uuid() - }); - }); - } - - function TargetDecisioningEngine(config) { - const logger = getLogger(config.logger); - let artifactProvider; - let artifact; - function getOffers(targetOptions) { - let { - request - } = targetOptions; - if (isUndefined(artifact)) { - return Promise.reject(new Error(Messages.ARTIFACT_NOT_AVAILABLE)); - } - if (!matchMajorVersion(artifact.version, SUPPORTED_ARTIFACT_MAJOR_VERSION)) { - return Promise.reject(new Error(Messages.ARTIFACT_VERSION_UNSUPPORTED(artifact.version, SUPPORTED_ARTIFACT_MAJOR_VERSION))); - } - return validDeliveryRequest(request, targetOptions.targetLocationHint, GeoProvider(config, artifact)).then(validRequest => { - request = validRequest; - const options = _objectSpread2(_objectSpread2({}, targetOptions), {}, { - request - }); - const traceProvider = TraceProvider(config, options, artifactProvider.getTrace()); - return DecisionProvider(config, options, createDecisioningContext(request), artifact, logger, traceProvider); - }); + function createExperienceCloud(experienceCloud, visitorValues) { + const result = {}; + const audienceManager = createAudienceManager(experienceCloud.audienceManager, visitorValues); + if (!isEmpty(audienceManager)) { + result.audienceManager = audienceManager; } - function isReady() { - return isDefined(artifact); + if (!isEmpty(experienceCloud.analytics)) { + result.analytics = experienceCloud.analytics; } - return ArtifactProvider(_objectSpread2(_objectSpread2({}, config), {}, { - logger - })).then(providerInstance => { - artifactProvider = providerInstance; - artifact = artifactProvider.getArtifact(); - if (isUndefined(artifact)) { - throw new Error(Messages.ARTIFACT_NOT_AVAILABLE); - } - artifactProvider.subscribe(data => { - artifact = data; - }); - return { - getRawArtifact: () => artifact, - stopPolling: () => artifactProvider.stopPolling(), - getOffers: targetOptions => getOffers(targetOptions), - hasRemoteDependency: request => hasRemoteDependency(artifact, request), - isReady - }; - }); - } - - function lowerCaseHeaders(headers) { - const headerKeys = []; - const headerEntries = []; - const headersObj = {}; - Object.keys(headers).forEach(key => { - const headerKey = key.toLowerCase(); - const headerValue = headers[key]; - headerKeys.push(headerKey); - headersObj[headerKey] = headerValue; - headerEntries.push([headerKey, headerValue]); - }); - return { - headerKeys, - headerEntries, - headersObj - }; + return result; } - function unfetchResponse(responseURL, headers, body, requestStatus = 200, statusText = "") { - const encoder = new TextEncoder(); - const decoder = new TextDecoder("utf-8"); - let bodyArrayBuffer; - let bodyString; - if (isString(body)) { - bodyString = body; - bodyArrayBuffer = encoder.encode(body).buffer; - } else if (body instanceof ArrayBuffer) { - bodyString = decoder.decode(new DataView(body)); - bodyArrayBuffer = body; + function createProperty(property, allParams) { + if (!isNil(property) && isNotBlank(property.token)) { + return property; } - const { - headerKeys, - headerEntries, - headersObj - } = lowerCaseHeaders(headers); - const response = () => ({ - ok: (requestStatus / 100 | 0) === 2, - statusText, - status: requestStatus, - url: responseURL, - text: () => reactorPromise.resolve(bodyString), - json: () => reactorPromise.resolve(JSON.parse(bodyString)), - blob: () => reactorPromise.resolve(new Blob([bodyArrayBuffer])), - arrayBuffer: () => reactorPromise.resolve(bodyArrayBuffer), - clone: response, - headers: { - keys: () => headerKeys, - entries: () => headerEntries, - get: n => headersObj[n.toLowerCase()], - has: n => n.toLowerCase() in headersObj - } - }); - return response(); - } - - const hasNativeFetch = typeof window !== "undefined" && typeof window.fetch === "function"; - function getFetchResponseFactory() { - return hasNativeFetch ? (url, headers, body) => new Response(new Blob([body], { - headers - })) : unfetchResponse; + const result = {}; + const token = getPropertyToken(allParams); + if (isNotBlank(token)) { + result.token = token; + } + return result; } - - const TARGET_STORAGE_PREFIX = "tgt"; - const REGEX_TARGET_LOCAL_STORAGE_KEY = new RegExp("^" + TARGET_STORAGE_PREFIX + ":.+", "i"); - const REGEX_RULES_ARTIFACT = /rules\.(json|txt)$/i; - const REGEX_CONTENT_TYPE_JSON = /(application\/json)|(text\/)/i; - const createFetchResponse = getFetchResponseFactory(); - const isTargetLocalStorageKey = key => REGEX_TARGET_LOCAL_STORAGE_KEY.test(key); - const isArtifactFile = url => url.match(REGEX_RULES_ARTIFACT); - const isJsonContentType = contentType => contentType && contentType.match(REGEX_CONTENT_TYPE_JSON); - const ARTIFACT_FETCH_DELAY = 1000; - function localStorageAvailable() { - try { - const storage = window["localStorage"]; - const x = "__storage_test__"; - storage.setItem(x, x); - storage.removeItem(x); - return true; - } catch (e) { - return false; + function createTrace(trace) { + if (!isNil(trace) && isNotBlank(trace.authorizationToken)) { + return trace; + } + const result = {}; + const authorizationToken = getTraceToken(); + if (isNotBlank(authorizationToken)) { + result.authorizationToken = authorizationToken; } + return result; } - const canCacheArtifact = localStorageAvailable(); - function getHeadersCacheKey(url) { - return TARGET_STORAGE_PREFIX + ":" + hashUnencodedChars(url) + ":h"; + function createPreview(preview) { + if (!isNil(preview)) { + return preview; + } + return getPreview(); } - function getBodyCacheKey(url) { - return TARGET_STORAGE_PREFIX + ":" + hashUnencodedChars(url) + ":b"; + function createQaMode(qaMode) { + if (!isNil(qaMode)) { + return qaMode; + } + return getQaMode(); } - function headersAsPOJO(headers) { + function createOrder(params) { const result = {}; - for (const [key, value] of headers.entries()) { - result[key] = value; + const orderId = getOrderId(params); + if (!isNil(orderId)) { + result.id = orderId; + } + const orderTotal = getOrderTotal(params); + const orderTotalNumber = parseFloat(orderTotal); + if (!isNaN(orderTotalNumber)) { + result.total = orderTotalNumber; + } + const purchasedProductIds = getPurchasedProductIds(params); + if (!isEmpty(purchasedProductIds)) { + result.purchasedProductIds = purchasedProductIds; } return result; } - function clearTargetLocalStorage() { - Object.keys(localStorage).filter(isTargetLocalStorageKey).forEach(key => localStorage.removeItem(key)); + function createProduct(params) { + const result = {}; + const productId = getProductId(params); + if (!isNil(productId)) { + result.id = productId; + } + const categoryId = getCategoryId(params); + if (!isNil(categoryId)) { + result.categoryId = categoryId; + } + return result; } - function storeJsonInLocalStorage(key, jsonValue) { - try { - localStorage.setItem(key, JSON.stringify(jsonValue)); - } catch (err) { - clearTargetLocalStorage(); + function createRequestDetails(item, allParams) { + const result = {}; + const params = reactorObjectAssign({}, getParams(allParams), getParams(item.parameters || {})); + const profileParams = reactorObjectAssign({}, getProfileParams(allParams), getProfileParams(item.profileParameters || {}, false)); + const order = reactorObjectAssign({}, createOrder(allParams), item.order || {}); + const product = reactorObjectAssign({}, createProduct(allParams), item.product || {}); + if (!isEmpty(params)) { + result.parameters = params; + } + if (!isEmpty(profileParams)) { + result.profileParameters = profileParams; + } + if (!isEmpty(order)) { + result.order = order; } + if (!isEmpty(product)) { + result.product = product; + } + return result; } - function getArtifactFromCache(url) { - if (!canCacheArtifact) { - return undefined; + function createMboxRequestDetails(item, allParams) { + let providersParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const { + index, + name, + address + } = item; + const params = reactorObjectAssign({}, name === globalMbox ? allParams : providersParams, getTargetPageParams(name)); + const result = createRequestDetails(item, params); + if (!isNil(index)) { + result.index = index; } - const cached = { - headers: localStorage.getItem(getHeadersCacheKey(url)), - body: localStorage.getItem(getBodyCacheKey(url)) - }; - if (cached.headers != null && cached.body != null) { - return cached; + if (isNotBlank(name)) { + result.name = name; } - return undefined; + if (!isEmpty(address)) { + result.address = address; + } + return result; } - function storeArtifactInCache(url, response) { - if (!canCacheArtifact) { - return resolve$1(); + function createViewRequestDetails(item, allParams) { + const { + name, + address + } = item; + const result = createRequestDetails(item, allParams); + if (isNotBlank(name)) { + result.name = name; } - const headers = headersAsPOJO(response.headers); - storeJsonInLocalStorage(getHeadersCacheKey(url), headers); - return response.clone().json().then(content => { - storeJsonInLocalStorage(getBodyCacheKey(url), content); - }); + if (!isEmpty(address)) { + result.address = address; + } + return result; } - function getFetchWithCaching(fetchApi) { - return function cachedFetch(url, options) { - if (!isArtifactFile(url)) { - return fetchApi(url, options); - } - const cachedArtifact = getArtifactFromCache(url); - function fetchAndCache(additionalOptions = {}) { - return fetchApi(url, _objectSpread2(_objectSpread2({}, options), additionalOptions)).then(response => { - if (isJsonContentType(response.headers.get("Content-Type"))) { - storeArtifactInCache(url, response); - } - return response; - }); - } - if (isDefined(cachedArtifact)) { - $(() => { - setTimeout(() => fetchAndCache(), ARTIFACT_FETCH_DELAY); - }); - return resolve$1(createFetchResponse(url, JSON.parse(cachedArtifact.headers), cachedArtifact.body)); + function createExecute(request, allParams, providersParams) { + const { + execute = {} + } = request; + const result = {}; + if (isEmpty(execute)) { + return result; + } + const { + pageLoad + } = execute; + if (!isNil(pageLoad)) { + result.pageLoad = createRequestDetails(pageLoad, allParams); + } + const { + mboxes + } = execute; + if (!isNil(mboxes) && isArray$1(mboxes) && !isEmpty(mboxes)) { + const temp = filter(notEmpty, map(e => createMboxRequestDetails(e, allParams, providersParams), mboxes)); + if (!isEmpty(temp)) { + result.mboxes = temp; } - return fetchAndCache(); - }; + } + return result; } - function ensureArtifactCached(decisioningConfig) { - if (!canCacheArtifact) { - return decisioningConfig; + function createPrefetch(request, allParams, providersParams) { + const { + prefetch = {} + } = request; + const result = {}; + if (isEmpty(prefetch)) { + return result; + } + const { + mboxes + } = prefetch; + if (!isNil(mboxes) && isArray$1(mboxes) && !isEmpty(mboxes)) { + result.mboxes = map(e => createMboxRequestDetails(e, allParams, providersParams), mboxes); + } + const { + views + } = prefetch; + if (!isNil(views) && isArray$1(views) && !isEmpty(views)) { + result.views = map(e => createViewRequestDetails(e, allParams), views); + } + return result; + } + function createAnalytics(consumerId, request) { + if (shouldUseOptin() && !isAnalyticsApproved()) { + return null; + } + const config = getConfig(); + const sdid = getSdidVisitorValue(consumerId); + const server = getVisitorProperty(TRACK_SERVER_PROP); + const serverSecure = getVisitorProperty(TRACK_SERVER_SECURE_PROP); + const { + experienceCloud = {} + } = request; + const { + analytics = {} + } = experienceCloud; + const { + logging, + supplementalDataId, + trackingServer, + trackingServerSecure + } = analytics; + const result = {}; + if (!isNil(logging)) { + result.logging = logging; + } else { + result.logging = config[ANALYTICS_LOGGING]; + } + if (!isNil(supplementalDataId)) { + result.supplementalDataId = supplementalDataId; + } + if (isNotBlank(sdid)) { + result.supplementalDataId = sdid; + } + if (!isNil(trackingServer)) { + result.trackingServer = trackingServer; + } + if (isNotBlank(server)) { + result.trackingServer = server; + } + if (!isNil(trackingServerSecure)) { + result.trackingServerSecure = trackingServerSecure; + } + if (isNotBlank(serverSecure)) { + result.trackingServerSecure = serverSecure; + } + if (isEmpty(result)) { + return null; + } + return result; + } + function createDeliveryRequest(request, visitorValues, providersParams) { + const allParams = getAllParams(providersParams); + const deviceId = getDeviceId(); + const thirdPartyId = getThirdPartyId(allParams); + const customerIdsValues = getCustomerIdsVisitorValues(); + const visitorId = createVisitorId(request.id || {}, deviceId, thirdPartyId, visitorValues, customerIdsValues); + const property = createProperty(request.property, allParams); + const experienceCloud = createExperienceCloud(request.experienceCloud || {}, visitorValues); + const trace = createTrace(request.trace); + const preview = createPreview(request.preview); + const qaMode = createQaMode(request.qaMode); + const execute = createExecute(request, allParams, providersParams); + const prefetch = createPrefetch(request, allParams, providersParams); + const { + notifications + } = request; + let result = {}; + result.requestId = uuid(); + result.context = createContext(request.context); + if (!isEmpty(visitorId)) { + result.id = visitorId; + } + if (!isEmpty(property)) { + result.property = property; + } + if (!isEmpty(trace)) { + result.trace = trace; } - const cachedArtifact = getArtifactFromCache(determineArtifactLocation(decisioningConfig)); - if (isDefined(cachedArtifact) || isDefined(decisioningConfig.artifactPayload)) { - return decisioningConfig; + if (!isEmpty(experienceCloud)) { + result.experienceCloud = experienceCloud; } - $(() => { - setTimeout(() => ArtifactProvider(decisioningConfig), ARTIFACT_FETCH_DELAY); - }); - throw new Error(NO_CACHED_ARTIFACT); - } - - const DEFAULT_POLLING_INTERVAL$1 = 0; - const eventbus = new tinyEmitter(); - let decisioningEnginePromise; - function getDecisioningMethod(config, options = {}) { - return options[DECISIONING_METHOD_SETTING] || config[DECISIONING_METHOD_SETTING]; - } - function isServerSideDecisioningMethod(config, options = {}) { - return getDecisioningMethod(config, options) === DECISIONING_METHOD.SERVER_SIDE; - } - function isHybridDecisioningMethod(config, options = {}) { - return getDecisioningMethod(config, options) === DECISIONING_METHOD.HYBRID; - } - function getPollingInterval(config) { - return isNumber(config[POLLING_INTERVAL_SETTING]) ? config[POLLING_INTERVAL_SETTING] : DEFAULT_POLLING_INTERVAL$1; + if (!isEmpty(preview)) { + result.preview = preview; + } + if (!isEmpty(qaMode)) { + result.qaMode = qaMode; + } + if (!isEmpty(execute)) { + result.execute = execute; + } + if (!isEmpty(prefetch)) { + result.prefetch = prefetch; + } + if (!isEmpty(notifications)) { + result.notifications = notifications; + } + result = window$1.__target_telemetry.addTelemetryToDeliveryRequest(result); + return result; } - function getArtifactLocation(config) { - return config[ARTIFACT_LOCATION_SETTING]; + function buildRequest(request, params, data) { + const visitorValues = data[0]; + const providersValues = data[1]; + const providersParams = reactorObjectAssign({}, providersValues, params); + return createDeliveryRequest(request, visitorValues, providersParams); } - function getArtifactFormat(config) { - return config[ARTIFACT_FORMAT_SETTING]; + function createAsyncDeliveryRequest(request, params) { + return getAsyncThirdPartyData().then(data => buildRequest(request, params, data)); } - function getArtifactPayload(config) { - return config[ARTIFACT_PAYLOAD_SETTING]; + function createSyncDeliveryRequest(request, params) { + const data = getSyncThirdPartyData(); + return buildRequest(request, params, data); } - function getTargetEnvironment$1(config) { - return config[TARGET_ENVIRONMENT_SETTING]; + + function saveView(view) { + const key = view.name; + const views = getItem(VIEWS) || {}; + views[key] = view; + setItem(VIEWS, views); } - function getCdnEnvironment$1(config) { - return config[CDN_ENVIRONMENT_SETTING]; + function findView(key) { + let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { + page = true + } = options; + const views = getItem(VIEWS) || {}; + const result = views[key]; + if (isNil(result)) { + return result; + } + const { + impressionId + } = options; + if (isNil(impressionId)) { + return result; + } + return reactorObjectAssign({ + page, + impressionId + }, result); } - function getTelemetryEnabled(config) { - return config[TELEMETRY_ENABLED_SETTING]; + function persistViews(views) { + forEach(saveView, views); } - function getCdnBasePath$1(config) { - return config[CDN_BASEPATH_SETTING]; + + const NAVIGATOR = "navigator"; + const SEND_BEACON = "sendBeacon"; + function executeSendBeacon(win, url, data) { + return win[NAVIGATOR][SEND_BEACON](url, data); } - function decisioningEngineRequired(config, options = {}) { - if (isAuthoringEnabled() || isQaMode() || isPreviewMode()) { + function executeSyncXhr(http, url, data) { + const headers = {}; + headers[CONTENT_TYPE] = [TEXT_PLAIN]; + const options = {}; + options[METHOD] = POST; + options[URL] = url; + options[DATA] = data; + options[CREDENTIALS] = true; + options[ASYNC] = false; + options[HEADERS] = headers; + try { + http(options); + } catch (error) { return false; } - return requiresDecisioningEngine(getDecisioningMethod(reactorObjectAssign({}, config), options)); - } - function ifOnDeviceDecisioningPossible(config) { - return !isServerSideDecisioningMethod(config) ? resolve$1() : reject$1(new Error(DECISIONING_ENGINE_NOT_READY)); + return true; } - function eventEmitter(eventName, payload) { - const config = getConfig(); - notifyOnDeviceDecisioning(eventName, payload); - eventbus.emit(eventName, payload); - if (eventName !== GEO_LOCATION_UPDATED) { - return; - } - const { - geoContext - } = payload; - if (isDefined(geoContext) && !isEmpty(Object.keys(geoContext))) { - const geoCookieLifetime = 7 * 24 * 60 * 60 * 1000; - const expires = new Date(now() + geoCookieLifetime); - const domain = config[COOKIE_DOMAIN]; - const secure = config[SECURE_ONLY]; - const attrs = reactorObjectAssign({ - expires, - domain, - secure - }, secure ? { - sameSite: SAMESITE_NONE - } : {}); - setCookie(GEO_COOKIE, JSON.stringify(geoContext), attrs); - } + function isBeaconSupported(win) { + return NAVIGATOR in win && SEND_BEACON in win[NAVIGATOR]; } - function getGeoContext(request) { - const geoCookie = getCookie(GEO_COOKIE); - const geoContext = reactorObjectAssign({}, isDefined(geoCookie) ? JSON.parse(geoCookie) : {}, request.context.geo); - if (isObject(geoContext) && isEmpty(Object.keys(geoContext))) { - return { - ipAddress: UNKNOWN_IP_ADDRESS - }; + function sendBeacon(url, data) { + if (isBeaconSupported(window$1)) { + return executeSendBeacon(window$1, url, data); } - return geoContext; + return executeSyncXhr(xhr, url, data); } - function prepareDecisioningConfig(config, sendNotificationFn, customFetch) { - const targetPageParams = getTargetPageParams(config[GLOBAL_MBOX_NAME]); - const propertyToken = getPropertyToken$1(targetPageParams); - const CONF = { - client: config[CLIENT_CODE], - organizationId: config[IMS_ORG_ID], - pollingInterval: getPollingInterval(config), - propertyToken, - environment: getTargetEnvironment$1(config), - cdnEnvironment: getCdnEnvironment$1(config), - cdnBasePath: getCdnBasePath$1(config), - telemetryEnabled: getTelemetryEnabled(config), - eventEmitter, - logger, - fetchApi: getFetchWithCaching(isFunction(customFetch) ? customFetch : getFetchApi(isFunction(window.fetch) ? window.fetch : noopPromise)), - sendNotificationFunc: options => { - logDebug("sendNotificationFunc", options); - const { - request - } = options; - if (isFunction(sendNotificationFn)) { - sendNotificationFn(request); - } + + const SEND_BEACON_SUCCESS = "Beacon data sent"; + const SEND_BEACON_ERROR = "Beacon data sent failed"; + const VIEW_TRIGGERED = "View triggered notification"; + const VIEW_RENDERED = "View rendered notification"; + const MBOXES_RENDERED = "Mboxes rendered notification"; + const EVENT_HANDLER = "Event handler notification"; + const MBOX_EVENT_HANDLER = "Mbox event handler notification"; + const VIEW_EVENT_HANDLER = "View event handler notification"; + const PREFETCH_MBOXES = "prefetchMboxes"; + const RENDERED = "rendered"; + const TRIGGERED = "triggered"; + function createRequest(consumerId) { + const analytics = createAnalytics(consumerId, {}); + const request = { + context: { + beacon: true } }; - const artifactPayload = getArtifactPayload(config); - return resolve$1(isDefined(artifactPayload) ? _objectSpread2(_objectSpread2({}, CONF), {}, { - artifactPayload - }) : _objectSpread2(_objectSpread2({}, CONF), {}, { - artifactFormat: getArtifactFormat(config), - artifactLocation: getArtifactLocation(config) - })); + if (!isEmpty(analytics)) { + const experienceCloud = {}; + experienceCloud.analytics = analytics; + request.experienceCloud = experienceCloud; + } + return request; } - function abortIfHybridAndArtifactNotCached(config, decisioningConfig) { - return isHybridDecisioningMethod(config) ? ensureArtifactCached(decisioningConfig) : decisioningConfig; + function createSyncNotificationRequest(consumerId, params, notifications) { + const request = createRequest(consumerId); + const result = createSyncDeliveryRequest(request, params); + result.notifications = notifications; + return result; } - function bootstrapDecisioningEngine(config, sendNotificationFn, customFetch = undefined) { - if (!decisioningEngineRequired(config)) { - return; - } - decisioningEnginePromise = undefined; - decisioningEnginePromise = prepareDecisioningConfig(config, sendNotificationFn, customFetch).then(decisioningConfig => abortIfHybridAndArtifactNotCached(config, decisioningConfig)).then(decisioningConfig => TargetDecisioningEngine(decisioningConfig)).then(instance => { - return instance; - })['catch'](err => { - if (isErrorWithMessage(err, NO_CACHED_ARTIFACT)) { - eventbus.once(ARTIFACT_DOWNLOAD_SUCCEEDED, payload => bootstrapDecisioningEngine(_objectSpread2(_objectSpread2({}, config), {}, { - artifactPayload: payload.artifactPayload - }), sendNotificationFn, customFetch)); - } - logDebug(err.message); - throw err; + function createAsyncNotificationRequest(consumerId, params, notifications) { + const request = createRequest(consumerId); + return createAsyncDeliveryRequest(request, params).then(result => { + result.notifications = notifications; + return result; }); } - function whenDecisioningEngineIsReady() { - return isDefined(decisioningEnginePromise) ? decisioningEnginePromise : reject$1(); + function createNotification(item, type, tokens) { + const id = uuid(); + const timestamp = now(); + const { + parameters, + profileParameters, + order, + product + } = item; + const result = { + id, + type, + timestamp, + parameters, + profileParameters, + order, + product + }; + if (isEmpty(tokens)) { + return result; + } + result.tokens = tokens; + return result; } - function executeDecisioningRequest(request) { + function createMboxNotification(mbox, type, tokens) { const { - context = {} - } = request; - return whenDecisioningEngineIsReady().then(decisioningEngine => { - return decisioningEngine.getOffers({ - request: _objectSpread2(_objectSpread2({}, request), {}, { - context: _objectSpread2(_objectSpread2({}, context), {}, { - geo: getGeoContext(request) - }) - }), - targetLocationHint: getEdgeCluster() - }).then(response => { - return reactorObjectAssign(response, { - decisioningMethod: DECISIONING_METHOD.ON_DEVICE - }); - }); - }); + name, + state + } = mbox; + const notification = createNotification(mbox, type, tokens); + notification.mbox = { + name, + state + }; + return notification; } - function hasRemoteDependency$1(request) { - return whenDecisioningEngineIsReady().then(decisioningEngine => decisioningEngine.hasRemoteDependency(request)); + function createViewNotification(view, type, tokens) { + const { + name, + state + } = view; + const notification = createNotification(view, type, tokens); + notification.view = { + name, + state + }; + return notification; } - - const INIT = "[page-init]"; - function handleError$1(error) { - logWarn(INIT, VIEW_DELIVERY_ERROR, error); - publish(NO_OFFERS_EVENT); + function executeBeaconNotification(request) { + const config = getConfig(); + const url = createRequestUrl(config); + const data = JSON.stringify(request); + if (sendBeacon(url, data)) { + logDebug(SEND_BEACON_SUCCESS, url, request); + return true; + } + logWarn(SEND_BEACON_ERROR, url, request); + return false; + } + function sendEventNotification(source, type, token) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const params = getTargetPageParams(globalMbox); + const requestDetails = createRequestDetails({}, params); + const notification = createNotification(requestDetails, type, [token]); + const request = createSyncNotificationRequest(uuid(), params, [notification]); + logDebug(EVENT_HANDLER, source, notification); addClientTrace({ - source: INIT, - error + source, + event: type, + request }); - removeHidingSnippetStyle(); + executeBeaconNotification(request); } - function handleSuccess(response, skipPrehiding = false) { - const options = { - selector: HEAD_TAG, - response + function sendMboxEventNotification(name, type, token) { + const params = getTargetPageParams(name); + const requestDetails = createRequestDetails({}, params); + const notification = createNotification(requestDetails, type, [token]); + notification.mbox = { + name }; - logDebug(INIT, RESPONSE, response); + const request = createSyncNotificationRequest(uuid(), params, [notification]); + logDebug(MBOX_EVENT_HANDLER, name, notification); addClientTrace({ - source: INIT, - response + mbox: name, + event: type, + request }); - executeApplyOffers(options, skipPrehiding)['catch'](handleError$1); + executeBeaconNotification(request); } - function scrubServerStateResponse(config, response) { - const result = reactorObjectAssign({}, response); - const { - execute, - prefetch - } = result; - const pageLoadEnabled = config[PAGE_LOAD_ENABLED]; - const viewsEnabled = config[VIEWS_ENABLED]; - if (execute) { - result.execute.mboxes = undefined; - } - if (execute && !pageLoadEnabled) { - result.execute.pageLoad = undefined; - } - if (prefetch) { - result.prefetch.mboxes = undefined; - } - if (prefetch && !viewsEnabled) { - result.prefetch.views = undefined; + function sendMboxesRenderedNotifications(items) { + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const notifications = []; + const type = DISPLAY_EVENT; + forEach(item => { + const { + mbox, + data + } = item; + if (isNil(data)) { + return; + } + const { + eventTokens = [] + } = data; + if (isEmpty(eventTokens)) { + return; + } + notifications.push(createMboxNotification(mbox, type, eventTokens)); + }, items); + if (isEmpty(notifications)) { + return; } - return result; - } - function processServerState(config) { - const serverState = getServerState(config); - const { - request, - response - } = serverState; - const skipPrehiding = true; - logDebug(INIT, USING_SERVER_STATE); + const request = createSyncNotificationRequest(globalMbox, {}, notifications); + logDebug(MBOXES_RENDERED, notifications); addClientTrace({ - source: INIT, - serverState + source: PREFETCH_MBOXES, + event: RENDERED, + request }); - const scrubbedResponse = scrubServerStateResponse(config, response); - hidePageLoadOptions(scrubbedResponse); - hideAllViews(scrubbedResponse); - processResponse({ - request, - response: scrubbedResponse - }).then(res => handleSuccess(res, skipPrehiding))['catch'](handleError$1); + executeBeaconNotification(request); } - function initDecisioningEngine() { + function sendViewEventNotification(name, type, token) { const config = getConfig(); - bootstrapDecisioningEngine(config, executeBeaconNotification); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const params = getTargetPageParams(globalMbox); + const requestDetails = createRequestDetails({}, params); + const notification = createNotification(requestDetails, type, [token]); + notification.view = { + name + }; + const request = createSyncNotificationRequest(uuid(), params, [notification]); + logDebug(VIEW_EVENT_HANDLER, name, notification); + addClientTrace({ + view: name, + event: type, + request + }); + executeBeaconNotification(request); } - function initDelivery() { - if (!isDeliveryEnabled() && !isAuthoringEnabled()) { - logWarn(INIT, DELIVERY_DISABLED); + function sendViewTriggeredNotifications(options) { + const { + viewName: name, + impressionId + } = options; + const config = getConfig(); + const globalMbox = config[GLOBAL_MBOX_NAME]; + const params = getTargetPageParams(globalMbox); + const requestDetails = createRequestDetails({}, params); + const notification = createNotification(requestDetails, DISPLAY_EVENT, []); + notification.view = { + name + }; + logDebug(VIEW_TRIGGERED, name); + createAsyncNotificationRequest(name, params, [notification]).then(request => { + request.impressionId = impressionId; addClientTrace({ - source: INIT, - error: DELIVERY_DISABLED + view: name, + event: TRIGGERED, + request }); + executeBeaconNotification(request); + }); + } + function sendViewRenderedNotifications(item) { + if (isNil(item)) { return; } - const config = getConfig(); - if (hasServerState(config)) { - processServerState(config); + const { + view, + data = {} + } = item; + const { + eventTokens = [] + } = data; + const { + name, + impressionId + } = view; + const persistedView = findView(name); + if (isNil(persistedView)) { return; } - const pageLoadEnabled = config[PAGE_LOAD_ENABLED]; - const viewsEnabled = config[VIEWS_ENABLED]; - if (!pageLoadEnabled && !viewsEnabled) { - logDebug(INIT, PAGE_LOAD_DISABLED); - addClientTrace({ - source: INIT, - error: PAGE_LOAD_DISABLED - }); + const notification = createViewNotification(persistedView, DISPLAY_EVENT, eventTokens); + const request = createSyncNotificationRequest(name, {}, [notification]); + request.impressionId = impressionId; + logDebug(VIEW_RENDERED, name, eventTokens); + addClientTrace({ + view: name, + event: RENDERED, + request + }); + executeBeaconNotification(request); + } + + const CACHE = {}; + const PAGE_LOAD = "pageLoadMetrics"; + const PREFETCH = "prefetchMetrics"; + const selectMetrics = prop(METRICS); + const createMetricSuccess = () => createSuccess(METRIC); + const createMetricError = error => createError$1(METRIC, error); + function decorateElementIfRequired(type, selector) { + if (type !== CLICK) { return; } - injectHidingSnippetStyle(); - const request = {}; - if (pageLoadEnabled) { - const execute = {}; - execute.pageLoad = {}; - request.execute = execute; + addClass(CLICK_TRACKING_CSS_CLASS, selector); + } + function isHandlerCached(name, key) { + return !isNil(CACHE[name]) && !isNil(CACHE[name][key]); + } + function removePreviousHandlersFromCache(currentViewName, type, selector) { + if (!isNil(CACHE[currentViewName])) { + return; } - if (viewsEnabled) { - const prefetch = {}; - prefetch.views = [{}]; - request.prefetch = prefetch; + const viewNames = keys(CACHE); + if (isEmpty(viewNames)) { + return; + } + forEach(viewName => { + const handlerNames = keys(CACHE[viewName]); + forEach(handlerName => { + const func = CACHE[viewName][handlerName]; + removeEventListener(type, func, selector); + }, handlerNames); + delete CACHE[viewName]; + }, viewNames); + } + function addHandlerToCache(name, key, handler) { + CACHE[name] = CACHE[name] || {}; + CACHE[name][key] = handler; + } + function attachEventHandler(name, fromView, metric, notifyFunc) { + const { + type, + selector, + eventToken + } = metric; + const key = hash(type + ":" + selector + ":" + eventToken); + const handler = () => notifyFunc(name, type, eventToken); + decorateElementIfRequired(type, selector); + if (!fromView) { + addEventListener(type, handler, selector); + return; } - const timeout = config[TIMEOUT]; - logDebug(INIT, REQUEST, request); - addClientTrace({ - source: INIT, - request - }); - const options = { - request, - timeout - }; - if (!shouldUseOptin() || isTargetApproved()) { - executeGetOffers(options).then(handleSuccess)['catch'](handleError$1); + if (isHandlerCached(name, key)) { return; } - fetchOptinPermissions().then(() => { - executeGetOffers(options).then(handleSuccess)['catch'](handleError$1); - })['catch'](handleError$1); + removePreviousHandlersFromCache(name, type, selector); + addHandlerToCache(name, key, handler); + addEventListener(type, handler, selector); + } + function processMetric(name, fromView, metric, notifyFunc) { + return executeMetric(metric).then(element => { + if (element.found) { + attachEventHandler(name, fromView, element, notifyFunc); + } + }); + } + function attachMetricEventHandlers(name, fromView, metrics, notifyFunc) { + return all(map(metric => processMetric(name, fromView, metric, notifyFunc), metrics)).then(createMetricSuccess)['catch'](createMetricError); + } + function executeMboxMetrics(mbox) { + const { + name + } = mbox; + return attachMetricEventHandlers(name, false, selectMetrics(mbox), sendMboxEventNotification); + } + function executeViewMetrics(view) { + const { + name + } = view; + return attachMetricEventHandlers(name, true, selectMetrics(view), sendViewEventNotification); + } + function executePageLoadMetrics(pageLoad) { + return attachMetricEventHandlers(PAGE_LOAD, false, selectMetrics(pageLoad), sendEventNotification); + } + function executePrefetchMetrics(prefetch) { + return attachMetricEventHandlers(PREFETCH, false, selectMetrics(prefetch), sendEventNotification); } - function createValid() { - const result = {}; - result[VALID] = true; - return result; + const selectContent = prop(CONTENT); + const selectCssSelector = prop(CSS_SELECTOR); + const createRenderSuccess = data => createSuccess(RENDER, data); + const createRenderError = error => createError$1(RENDER, error); + const hasNonErrorData = val => not(isError)(val) && hasData(val); + function hideActions(actions) { + const items = map(selectCssSelector, actions); + injectActionHidingStyles(filterNotBlank(items)); } - function createInvalid(error) { - const result = {}; - result[VALID] = false; - result[ERROR] = error; - return result; + function hideAllViewsActions(actions) { + const items = map(selectCssSelector, actions); + injectAllViewsHidingStyle(filterNotNil(items)); } - function validateMbox(mbox) { - if (isBlank(mbox)) { - return createInvalid(MBOX_REQUIRED); + function extractActions(item) { + const options = filter(isActions, selectOptions(item)); + return flatten(map(selectContent, options)); + } + function isValidAction(action) { + return isObject(action) && action.type !== SET_JSON; + } + function decorateActions(actions, key, page) { + return map(e => reactorObjectAssign({ + key, + page + }, e), filter(isValidAction, actions)); + } + function executeRendering(option, key, page) { + const { + eventToken, + responseTokens, + content + } = option; + const actions = decorateActions(content, key, page); + return executeRenderActions(actions).then(() => createRenderSuccess({ + eventToken, + responseTokens + }))['catch'](createRenderError); + } + function isValidOption(option) { + return isObject(option) && option.type !== JSON$1; + } + function renderOptions(func, item) { + return map(func, filter(isValidOption, selectOptions(item))); + } + function postExecuteRendering(key, item, values) { + const result = { + status: SUCCESS, + [key]: item + }; + const errors = map(selectData, filter(isError, values)); + const data = {}; + if (!isEmpty(errors)) { + result.status = ERROR; + data.errors = errors; } - if (mbox.length > MBOX_LENGTH) { - return createInvalid(MBOX_TOO_LONG); + if (!isEmpty(data)) { + result.data = data; } - return createValid(); + return result; } - function validateGetOfferOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); + function postPrefetchRendering(key, item, values) { + const result = { + status: SUCCESS, + [key]: item + }; + const errors = map(selectData, filter(isError, values)); + const renderData = map(selectData, filter(hasNonErrorData, values)); + const eventTokens = filterNotNil(map(selectEventToken, renderData)); + const responseTokens = filterNotNil(map(selectResponseTokens, renderData)); + const data = {}; + if (!isEmpty(errors)) { + result.status = ERROR; + data.errors = errors; } - const mbox = options[MBOX]; - const mboxValidation = validateMbox(mbox); - if (!mboxValidation[VALID]) { - return mboxValidation; + if (!isEmpty(eventTokens)) { + data.eventTokens = eventTokens; } - if (!isFunction(options[SUCCESS])) { - return createInvalid(SUCCESS_REQUIRED); + if (!isEmpty(responseTokens)) { + data.responseTokens = responseTokens; } - if (!isFunction(options[ERROR])) { - return createInvalid(ERROR_REQUIRED); + if (!isEmpty(data)) { + result.data = data; } - return createValid(); + return result; } - function validateGetOffersOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); - } + function renderExecuteItem(item, postRenderingFunc, metricsFunc) { + const render = opt => executeRendering(opt, true); + const options = renderOptions(render, item); + return all(options).then(postRenderingFunc).then(result => { + metricsFunc(item); + return result; + }); + } + function renderPrefetchItem(key, item, page, metricsFunc) { const { - request - } = options; - if (!isObject(request)) { - return createInvalid(REQUEST_REQUIRED); + name + } = item; + const render = opt => executeRendering(opt, name, page); + const options = renderOptions(render, item); + return all(options).then(arr => postPrefetchRendering(key, item, arr)).then(result => { + metricsFunc(item); + return result; + }); + } + function renderMbox(mbox) { + const postRenderingFunc = arr => postExecuteRendering(MBOX, mbox, arr); + return renderExecuteItem(mbox, postRenderingFunc, executeMboxMetrics); + } + function renderPrefetchMbox(mbox) { + return renderPrefetchItem(MBOX, mbox, true, executeMboxMetrics); + } + function hideOptions(item) { + const actions = extractActions(item); + hideActions(actions); + } + function hidePageLoadOptions(context) { + let skipPrehiding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + if (skipPrehiding) { + return; } const { - execute, - prefetch - } = request; - if (!isObject(execute) && !isObject(prefetch)) { - return createInvalid(EXECUTE_OR_PREFETCH_REQUIRED); + execute = {} + } = context; + const { + pageLoad = {} + } = execute; + if (!isEmpty(pageLoad)) { + hideOptions(pageLoad); } - return createValid(); } - function validateSendNotificationsOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); - } + function hideAllViews(context) { const { - request - } = options; - if (!isObject(request)) { - return createInvalid(REQUEST_REQUIRED); - } + prefetch = {} + } = context; const { - execute, - prefetch, - notifications - } = request; - if (isObject(execute) || isObject(prefetch)) { - return createInvalid(EXECUTE_OR_PREFETCH_NOT_ALLOWED); - } - if (!isArray(notifications)) { - return createInvalid(NOTIFICATIONS_REQUIRED); + views = [] + } = prefetch; + if (isEmpty(views)) { + return; } - return createValid(); + const actions = flatten(map(extractActions, views)); + hideAllViewsActions(actions); } - function validateApplyOfferOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); - } - const mbox = options[MBOX]; - const mboxValidation = validateMbox(mbox); - if (!mboxValidation[VALID]) { - return mboxValidation; - } - const offer = options[OFFER]; - if (!isArray(offer)) { - return createInvalid(OFFER_REQUIRED); - } - return createValid(); + function hideViewOptions(view) { + const actions = extractActions(view); + hideActions(actions); + removeAllViewsHidingStyle(); } - function validateApplyOffersOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); - } - const { - response - } = options; - if (!isObject(response)) { - return createInvalid(RESPONE_REQUIRED); - } - return createValid(); + function renderPageLoad(pageLoad) { + const postRenderingFunc = arr => postExecuteRendering(PAGE_LOAD$1, pageLoad, arr); + return renderExecuteItem(pageLoad, postRenderingFunc, executePageLoadMetrics); + } + function renderMboxes(mboxes) { + return all(map(renderMbox, mboxes)); + } + function renderPrefetchMboxes(mboxes) { + return all(map(renderPrefetchMbox, mboxes)); } - function validateTrackEventOptions(options) { - if (!isObject(options)) { - return createInvalid(OPTIONS_REQUIRED); - } - const mbox = options[MBOX]; - const mboxValidation = validateMbox(mbox); - if (!mboxValidation[VALID]) { - return mboxValidation; - } - return createValid(); + function renderPrefetchMetrics(prefetch) { + const metrics = [executePrefetchMetrics(prefetch)]; + return all(metrics).then(postExecuteRendering); + } + function renderView(view) { + const { + page + } = view; + return renderPrefetchItem(VIEW, view, page, executeViewMetrics); } - const EDGE_SERVER_PREFIX$1 = "mboxedge"; - const EDGE_SERVER_DOMAIN$1 = ".tt.omtrdc.net"; - const notEmpty$1 = val => !isEmpty(val); - function throwIfOptout$1(values) { - const optout = values[MCOPTOUT]; - if (optout) { - throw new Error(OPTOUT_MESSAGE); - } - return values; + function create() { + return new EventEmitter(); } - function getAsyncThirdPartyData$1() { - const visitorValues = getAsyncVisitorValues(); - const dataProvidersParams = getAsyncDataProvidersParameters(); - return all([visitorValues.then(throwIfOptout$1), dataProvidersParams]); + function publishOn(eventBus, name, args) { + eventBus.emit(name, args); } - function getAllParams$1(providersParams) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; - return reactorObjectAssign({}, providersParams, getTargetPageParams(globalMbox)); + function subscribeTo(eventBus, name, func) { + eventBus.on(name, func); } - function getTimeOffset$1() { - return -new Date().getTimezoneOffset(); + + const EVENT_BUS = create(); + function publish(name, args) { + publishOn(EVENT_BUS, name, args); } - function createScreen$1() { - const { - screen - } = window; - return { - width: screen.width, - height: screen.height, - orientation: getScreenOrientation(), - colorDepth: screen.colorDepth, - pixelRatio: getPixelRatio() - }; + function subscribe(name, func) { + subscribeTo(EVENT_BUS, name, func); } - function createWindow$1() { - const { - documentElement - } = document; + + function redirect$1(option) { return { - width: documentElement.clientWidth, - height: documentElement.clientHeight + type: REDIRECT, + content: option.url }; } - function createBrowser$1() { - const { - location - } = window; - return { - host: location.hostname, - webGLRenderer: getWebGLRenderer() - }; + function setContent(action) { + const result = {}; + result.type = SET_HTML; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; } - function createAddress$1() { - const { - location - } = window; - return { - url: location.href, - referringUrl: document.referrer - }; + function setText$1(action) { + const result = {}; + result.type = SET_TEXT; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; } - function createContext$1(context) { - if (!isNil(context) && context.channel === WEB_CHANNEL) { - return context; - } - const validContext = context || {}; - const { - beacon - } = validContext; - return { - userAgent: window.navigator.userAgent, - timeOffsetInMinutes: getTimeOffset$1(), - channel: WEB_CHANNEL, - screen: createScreen$1(), - window: createWindow$1(), - browser: createBrowser$1(), - address: createAddress$1(), - geo: context && context.geo, - beacon - }; + function appendContent(action) { + const result = {}; + result.type = APPEND_HTML; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; } - function createAudienceManager$1(audienceManager, visitorValues) { - if (!isNil(audienceManager)) { - return audienceManager; - } + function prependContent(action) { const result = {}; - if (isEmpty(visitorValues)) { + result.type = PREPEND_HTML; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function replaceContent(action) { + const result = {}; + result.type = REPLACE_HTML; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function insertBefore$1(action) { + const result = {}; + result.type = INSERT_BEFORE; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function insertAfter$1(action) { + const result = {}; + result.type = INSERT_AFTER; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function customCode$1(action) { + const result = {}; + result.type = CUSTOM_CODE; + result.content = action.content; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function setAttribute$1(action) { + const result = {}; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + if (action.attribute === SRC) { + result.type = SET_IMAGE_SOURCE; + result.content = action.value; return result; } - const locationHint = visitorValues[MCAAMLH]; - const locationHintNumber = parseInt(locationHint, 10); - if (!isNaN(locationHintNumber)) { - result.locationHint = locationHintNumber; + result.type = SET_ATTRIBUTE; + const content = {}; + content[action.attribute] = action.value; + result.content = content; + return result; + } + function setStyle$1(action) { + const { + style = {} + } = action; + const result = {}; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + if (!isNil(style.left) && !isNil(style.top)) { + result.type = MOVE; + result.content = style; + return result; } - const blob = visitorValues[MCAAMB]; - if (isNotBlank(blob)) { - result.blob = blob; + if (!isNil(style.width) && !isNil(style.height)) { + result.type = RESIZE; + result.content = style; + return result; } + result.type = SET_STYLE; + result.content = style; return result; } - function createCustomerId$1(data) { - const { - id, - integrationCode, - authenticatedState, - type, - primary - } = data; + function remove$1(action) { const result = {}; - if (isNotBlank(id)) { - result.id = id; + result.type = REMOVE; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + return result; + } + function rearrange$1(action) { + const content = {}; + content.from = action.from; + content.to = action.to; + const result = {}; + result.type = REARRANGE; + result.selector = action.selector; + result.cssSelector = action.cssSelector; + result.content = content; + return result; + } + function hasSelectors(action) { + return isNotBlank(action.selector) && isNotBlank(action.cssSelector); + } + function createPageLoad(items) { + const result = {}; + if (isEmpty(items)) { + return result; } - if (isNotBlank(integrationCode)) { - result.integrationCode = integrationCode; + const options = []; + const metrics = []; + const actions = []; + forEach(item => { + const type = item.action; + switch (type) { + case SET_CONTENT: + if (hasSelectors(item)) { + actions.push(setContent(item)); + } else { + options.push({ + type: HTML, + content: item.content + }); + } + break; + case SET_JSON: + if (!isEmpty(item.content)) { + forEach(e => options.push({ + type: JSON$1, + content: e + }), item.content); + } + break; + case SET_TEXT: + actions.push(setText$1(item)); + break; + case APPEND_CONTENT: + actions.push(appendContent(item)); + break; + case PREPEND_CONTENT: + actions.push(prependContent(item)); + break; + case REPLACE_CONTENT: + actions.push(replaceContent(item)); + break; + case INSERT_BEFORE: + actions.push(insertBefore$1(item)); + break; + case INSERT_AFTER: + actions.push(insertAfter$1(item)); + break; + case CUSTOM_CODE: + actions.push(customCode$1(item)); + break; + case SET_ATTRIBUTE: + actions.push(setAttribute$1(item)); + break; + case SET_STYLE: + actions.push(setStyle$1(item)); + break; + case REMOVE: + actions.push(remove$1(item)); + break; + case REARRANGE: + actions.push(rearrange$1(item)); + break; + case REDIRECT: + options.push(redirect$1(item)); + break; + case TRACK_CLICK: + metrics.push({ + type: CLICK, + selector: item.selector, + eventToken: item.clickTrackId + }); + break; + } + }, items); + const pageLoad = {}; + const hasActions = !isEmpty(actions); + if (hasActions) { + options.push({ + type: ACTIONS, + content: actions + }); } - if (isNotBlank(authenticatedState)) { - result.authenticatedState = authenticatedState; + const hasOptions = !isEmpty(options); + if (hasOptions) { + pageLoad.options = options; } - if (isNotBlank(type)) { - result.type = type; + const hasMetrics = !isEmpty(metrics); + if (hasMetrics) { + pageLoad.metrics = metrics; } - if (primary) { - result.primary = primary; + if (isEmpty(pageLoad)) { + return result; } + const execute = {}; + execute.pageLoad = pageLoad; + result.execute = execute; return result; } - function createCustomerIds$1(customerIdsValues) { - return map(createCustomerId$1, customerIdsValues); - } - function createVisitorId$1(id, deviceId, thirdPartyId, visitorValues, customerIdsValues) { + function createMboxes(name, items) { const result = {}; - if (isNotBlank(deviceId)) { - result.tntId = deviceId; - } - if (isNotBlank(thirdPartyId)) { - result.thirdPartyId = thirdPartyId; - } - if (isNotBlank(id.thirdPartyId)) { - result.thirdPartyId = id.thirdPartyId; + if (isEmpty(items)) { + return result; } - const mid = visitorValues[MCMID]; - if (isNotBlank(mid)) { - result.marketingCloudVisitorId = mid; + const options = []; + const metrics = []; + forEach(item => { + const type = item.action; + switch (type) { + case SET_CONTENT: + options.push({ + type: HTML, + content: item.content + }); + break; + case SET_JSON: + if (!isEmpty(item.content)) { + forEach(e => options.push({ + type: JSON$1, + content: e + }), item.content); + } + break; + case REDIRECT: + options.push(redirect$1(item)); + break; + case SIGNAL_CLICK: + metrics.push({ + type: CLICK, + eventToken: item.clickTrackId + }); + break; + } + }, items); + const mbox = { + name + }; + const hasOptions = !isEmpty(options); + if (hasOptions) { + mbox.options = options; } - if (isNotBlank(id.marketingCloudVisitorId)) { - result.marketingCloudVisitorId = id.marketingCloudVisitorId; + const hasMetrics = !isEmpty(metrics); + if (hasMetrics) { + mbox.metrics = metrics; } - if (!isEmpty(id.customerIds)) { - result.customerIds = id.customerIds; + if (isEmpty(mbox)) { return result; } - if (!isEmpty(customerIdsValues)) { - result.customerIds = createCustomerIds$1(customerIdsValues); - } + const execute = {}; + const mboxes = [mbox]; + execute.mboxes = mboxes; + result.execute = execute; return result; } - function createExperienceCloud$1(experienceCloud, visitorValues) { - const result = {}; - const audienceManager = createAudienceManager$1(experienceCloud.audienceManager, visitorValues); - if (!isEmpty(audienceManager)) { - result.audienceManager = audienceManager; - } - if (!isEmpty(experienceCloud.analytics)) { - result.analytics = experienceCloud.analytics; + function convertToContext(mbox, items, pageLoadEnabled) { + if (pageLoadEnabled) { + return createPageLoad(items); } - return result; + return createMboxes(mbox, items); } - function createProperty$1(property, allParams) { - if (!isNil(property) && isNotBlank(property.token)) { - return property; - } - const result = {}; - const token = getPropertyToken$1(allParams); - if (isNotBlank(token)) { - result.token = token; + + const PAGE_LOAD_RENDERING_FAILED = "Page load rendering failed"; + const MBOXES_RENDERING_FAILED = "Mboxes rendering failed"; + const VIEW_RENDERING_FAILED = "View rendering failed"; + const PREFETCH_RENDERING_FAILED = "Prefetch rendering failed"; + const hasErrors = items => !isEmpty(filter(isError, items)); + function getPageLoadData(pageLoad) { + const { + status, + data + } = pageLoad; + const result = { + status, + pageLoad: true + }; + if (!isNil(data)) { + result.data = data; } return result; } - function createTrace$2(trace) { - if (!isNil(trace) && isNotBlank(trace.authorizationToken)) { - return trace; - } - const result = {}; - const authorizationToken = getTraceToken(); - if (isNotBlank(authorizationToken)) { - result.authorizationToken = authorizationToken; + function getMboxData(item) { + const { + status, + mbox, + data + } = item; + const { + name + } = mbox; + const result = { + status, + mbox: name + }; + if (!isNil(data)) { + result.data = data; } return result; } - function createPreview$1(preview) { - if (!isNil(preview)) { - return preview; + function getViewData(item) { + const { + status, + view, + data + } = item; + const { + name + } = view; + const result = { + status, + view: name + }; + if (!isNil(data)) { + result.data = data; } - return getPreview(); + return result; } - function createQaMode$1(qaMode) { - if (!isNil(qaMode)) { - return qaMode; + function getPrefetchMetricsData(prefetchMetrics) { + const { + status, + data + } = prefetchMetrics; + const result = { + status, + prefetchMetrics: true + }; + if (!isNil(data)) { + result.data = data; } - return getQaMode(); + return result; } - function createOrder$1(params) { - const result = {}; - const orderId = getOrderId(params); - if (!isNil(orderId)) { - result.id = orderId; - } - const orderTotal = getOrderTotal(params); - const orderTotalNumber = parseFloat(orderTotal); - if (!isNaN(orderTotalNumber)) { - result.total = orderTotalNumber; + function handlePageLoad(pageLoad) { + if (isNil(pageLoad)) { + return [null]; } - const purchasedProductIds = getPurchasedProductIds(params); - if (!isEmpty(purchasedProductIds)) { - result.purchasedProductIds = purchasedProductIds; + const result = map(getPageLoadData, [pageLoad]); + if (hasErrors(result)) { + logWarn(PAGE_LOAD_RENDERING_FAILED, pageLoad); } return result; } - function createProduct$1(params) { - const result = {}; - const productId = getProductId(params); - if (!isNil(productId)) { - result.id = productId; + function handleMboxes(mboxes) { + if (isNil(mboxes)) { + return [null]; } - const categoryId = getCategoryId(params); - if (!isNil(categoryId)) { - result.categoryId = categoryId; + const result = map(getMboxData, mboxes); + if (hasErrors(result)) { + logWarn(MBOXES_RENDERING_FAILED, mboxes); } return result; } - function createRequestDetails$1(item, allParams) { - const result = {}; - const params = reactorObjectAssign({}, getParams$1(allParams), item.parameters || {}); - const profileParams = reactorObjectAssign({}, getProfileParams(allParams), item.profileParameters || {}); - const order = reactorObjectAssign({}, createOrder$1(allParams), item.order || {}); - const product = reactorObjectAssign({}, createProduct$1(allParams), item.product || {}); - if (!isEmpty(params)) { - result.parameters = params; - } - if (!isEmpty(profileParams)) { - result.profileParameters = profileParams; - } - if (!isEmpty(order)) { - result.order = order; + function handlePrefetchMboxes(mboxes) { + let func = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : sendMboxesRenderedNotifications; + if (isNil(mboxes)) { + return [null]; } - if (!isEmpty(product)) { - result.product = product; + const result = map(getMboxData, mboxes); + if (hasErrors(result)) { + logWarn(MBOXES_RENDERING_FAILED, mboxes); } + func(mboxes); return result; } - function createMboxRequestDetails$1(item, allParams, providersParams = {}) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; + function handleView(item) { + let func = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : sendViewRenderedNotifications; + if (isNil(item)) { + return [null]; + } + const result = map(getViewData, [item]); + if (hasErrors(result)) { + logWarn(VIEW_RENDERING_FAILED, item); + } const { - index, - name, - address + view } = item; - const params = reactorObjectAssign({}, name === globalMbox ? allParams : providersParams, getTargetPageParams(name)); - const result = createRequestDetails$1(item, params); - if (!isNil(index)) { - result.index = index; + if (!view.page) { + return result; } - if (isNotBlank(name)) { - result.name = name; + func(item); + return result; + } + function handlePrefetchMetrics(prefetchMetrics) { + if (isNil(prefetchMetrics)) { + return [null]; } - if (!isEmpty(address)) { - result.address = address; + const result = map(getPrefetchMetricsData, [prefetchMetrics]); + if (hasErrors(result)) { + logWarn(PREFETCH_RENDERING_FAILED, prefetchMetrics); } return result; } - function createViewRequestDetails$1(item, allParams) { + function handleRenderingSuccess(values) { + const results = flatten([handlePageLoad(values[0]), handleMboxes(values[1]), handlePrefetchMboxes(values[2]), handlePrefetchMetrics(values[3])]); + const nonNull = filter(notNil, results); + const errors = filter(isError, nonNull); + if (!isEmpty(errors)) { + return reject(errors); + } + return resolve(nonNull); + } + function handleRenderingError(err) { + return reject(err); + } + + function processOptions(selector, item) { + if (isEmpty(item)) { + return; + } const { - name, - address + options } = item; - const result = createRequestDetails$1(item, allParams); - if (isNotBlank(name)) { - result.name = name; - } - if (!isEmpty(address)) { - result.address = address; + if (isEmpty(options)) { + return; } - return result; + forEach(option => { + if (option.type !== HTML) { + return; + } + const type = SET_HTML; + const { + content + } = option; + option.type = ACTIONS; + option.content = [{ + type, + selector, + content + }]; + }, options); } - function createExecute$1(request, allParams, providersParams) { + function processMetrics$1(selector, item) { const { - execute = {} - } = request; - const result = {}; - if (isEmpty(execute)) { - return result; + metrics + } = item; + if (isEmpty(metrics)) { + return; } const { - pageLoad - } = execute; - if (!isNil(pageLoad)) { - result.pageLoad = createRequestDetails$1(pageLoad, allParams); - } + name + } = item; + forEach(metric => { + metric.name = name; + metric.selector = metric.selector || selector; + }, metrics); + } + function createRenderingContext(selector, context) { + const result = reactorObjectAssign({}, context); const { - mboxes + execute = {}, + prefetch = {} + } = result; + const { + pageLoad = {}, + mboxes = [] } = execute; - if (!isNil(mboxes) && isArray(mboxes) && !isEmpty(mboxes)) { - const temp = filter(notEmpty$1, map(e => createMboxRequestDetails$1(e, allParams, providersParams), mboxes)); - if (!isEmpty(temp)) { - result.mboxes = temp; - } - } + const { + mboxes: prefetchMboxes = [] + } = prefetch; + processOptions(selector, pageLoad); + forEach(elem => processOptions(selector, elem), mboxes); + forEach(elem => processMetrics$1(selector, elem), mboxes); + forEach(elem => processOptions(selector, elem), prefetchMboxes); + forEach(elem => processMetrics$1(selector, elem), prefetchMboxes); return result; } - function createPrefetch$1(request, allParams, providersParams) { + function persistViewsIfPresent(context) { const { prefetch = {} - } = request; - const result = {}; - if (isEmpty(prefetch)) { - return result; - } + } = context; const { - mboxes + views = [] } = prefetch; - if (!isNil(mboxes) && isArray(mboxes) && !isEmpty(mboxes)) { - result.mboxes = map(e => createMboxRequestDetails$1(e, allParams, providersParams), mboxes); + if (isEmpty(views)) { + return; } + persistViews(views); + } + function renderContext(context) { + const promises = []; const { - views + execute = {} + } = context; + const { + pageLoad = {}, + mboxes = [] + } = execute; + if (!isEmpty(pageLoad)) { + promises.push(renderPageLoad(pageLoad)); + } else { + promises.push(resolve(null)); + } + if (!isEmpty(mboxes)) { + promises.push(renderMboxes(mboxes)); + } else { + promises.push(resolve(null)); + } + const { + prefetch = {} + } = context; + const { + mboxes: prefetchMboxes = [], + metrics = [] } = prefetch; - if (!isNil(views) && isArray(views) && !isEmpty(views)) { - result.views = map(e => createViewRequestDetails$1(e, allParams), views); + if (!isEmpty(prefetchMboxes)) { + promises.push(renderPrefetchMboxes(prefetchMboxes)); + } else { + promises.push(resolve(null)); } - return result; + if (isArray$1(metrics) && !isEmpty(metrics)) { + promises.push(renderPrefetchMetrics(prefetch)); + } else { + promises.push(resolve(null)); + } + removeHidingSnippetStyle(); + return all(promises).then(handleRenderingSuccess)['catch'](handleRenderingError); } - function createAnalytics$1(consumerId, request) { - if (shouldUseOptin() && !isAnalyticsApproved()) { - return null; + function executeRedirect(win, url) { + delay(() => win.location.replace(url)); + } + function retrieveSelector(selector) { + if (isNotBlank(selector)) { + return selector; } + if (isElement(selector)) { + return selector; + } + return HEAD_TAG; + } + function showElement(selector) { + addClass(MARKER_CSS_CLASS, selector); + } + function executeApplyOffer(options) { + const { + mbox, + selector, + offer: actions + } = options; const config = getConfig(); - const sdid = getSdidVisitorValue(consumerId); - const server = getVisitorProperty(TRACK_SERVER_PROP); - const serverSecure = getVisitorProperty(TRACK_SERVER_SECURE_PROP); + const pageLoadEnabled = mbox === config[GLOBAL_MBOX_NAME]; + if (isEmpty(actions)) { + logDebug(NO_ACTIONS); + showElement(selector); + removeHidingSnippetStyle(); + notifyRenderingNoOffers({ + mbox + }); + return; + } + const context = convertToContext(mbox, actions, pageLoadEnabled); + const renderingContext = createRenderingContext(selector, context); + const redirect = getRedirect(renderingContext); + if (!isEmpty(redirect)) { + const { + url + } = redirect; + logDebug(REDIRECT_ACTION, redirect); + notifyRenderingRedirect({ + url + }); + executeRedirect(window$1, url); + return; + } + notifyRenderingStart({ + mbox + }); + hidePageLoadOptions(renderingContext); + renderContext(renderingContext).then(execution => { + if (isEmpty(execution)) { + return; + } + notifyRenderingSucceeded({ + mbox, + execution + }); + })['catch'](error => notifyRenderingFailed({ + error + })); + } + function isEmptyResponse() { + let response = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + const { + prefetch = {} + } = response; + const { + execute = {} + } = response; + const { + pageLoad: executePageLoad = {} + } = execute; const { - experienceCloud = {} - } = request; + mboxes: executeMboxes = [] + } = execute; const { - analytics = {} - } = experienceCloud; + pageLoad: prefetchPageLoad = {} + } = prefetch; const { - logging, - supplementalDataId, - trackingServer, - trackingServerSecure - } = analytics; - const result = {}; - if (!isNil(logging)) { - result.logging = logging; - } else { - result.logging = config[ANALYTICS_LOGGING]; - } - if (!isNil(supplementalDataId)) { - result.supplementalDataId = supplementalDataId; - } - if (isNotBlank(sdid)) { - result.supplementalDataId = sdid; - } - if (!isNil(trackingServer)) { - result.trackingServer = trackingServer; - } - if (isNotBlank(server)) { - result.trackingServer = server; - } - if (!isNil(trackingServerSecure)) { - result.trackingServerSecure = trackingServerSecure; - } - if (isNotBlank(serverSecure)) { - result.trackingServerSecure = serverSecure; - } - if (isEmpty(result)) { - return null; - } - return result; + views = [] + } = prefetch; + const { + mboxes: prefetchMboxes = [] + } = prefetch; + return isEmpty(executePageLoad) && isEmpty(executeMboxes) && isEmpty(prefetchPageLoad) && isEmpty(views) && isEmpty(prefetchMboxes); } - function createDeliveryRequest$1(request, visitorValues, providersParams) { - const allParams = getAllParams$1(providersParams); - const deviceId = getDeviceId(); - const thirdPartyId = getThirdPartyId(allParams); - const customerIdsValues = getCustomerIdsVisitorValues(); - const visitorId = createVisitorId$1(request.id || {}, deviceId, thirdPartyId, visitorValues, customerIdsValues); - const property = createProperty$1(request.property, allParams); - const experienceCloud = createExperienceCloud$1(request.experienceCloud || {}, visitorValues); - const trace = createTrace$2(request.trace); - const preview = createPreview$1(request.preview); - const qaMode = createQaMode$1(request.qaMode); - const execute = createExecute$1(request, allParams, providersParams); - const prefetch = createPrefetch$1(request, allParams, providersParams); + function executeApplyOffers(options) { + let skipPrehiding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; const { - notifications - } = request; - const result = {}; - result.requestId = uuid(); - result.context = createContext$1(request.context); - if (!isEmpty(visitorId)) { - result.id = visitorId; - } - if (!isEmpty(property)) { - result.property = property; - } - if (!isEmpty(trace)) { - result.trace = trace; - } - if (!isEmpty(experienceCloud)) { - result.experienceCloud = experienceCloud; - } - if (!isEmpty(preview)) { - result.preview = preview; + selector, + response + } = options; + if (isEmptyResponse(response)) { + logDebug(NO_ACTIONS); + showElement(selector); + removeHidingSnippetStyle(); + notifyRenderingNoOffers({}); + publish(NO_OFFERS_EVENT); + return resolve(); } - if (!isEmpty(qaMode)) { - result.qaMode = qaMode; + const renderingContext = createRenderingContext(selector, response); + const redirect = getRedirect(renderingContext); + if (!isEmpty(redirect)) { + const { + url + } = redirect; + logDebug(REDIRECT_ACTION, redirect); + notifyRenderingRedirect({ + url + }); + publish(REDIRECT_OFFER_EVENT); + executeRedirect(window$1, url); + return resolve(); } - if (!isEmpty(execute)) { - result.execute = execute; + notifyRenderingStart({}); + persistViewsIfPresent(renderingContext); + publish(CACHE_UPDATED_EVENT); + hidePageLoadOptions(renderingContext, skipPrehiding); + return renderContext(renderingContext).then(execution => { + if (isEmpty(execution)) { + return; + } + notifyRenderingSucceeded({ + execution + }); + })['catch'](error => notifyRenderingFailed({ + error + })); + } + + function hasServerState(config) { + const serverState = config[SERVER_STATE]; + if (isEmpty(serverState)) { + return false; } - if (!isEmpty(prefetch)) { - result.prefetch = prefetch; + const { + request, + response + } = serverState; + if (isEmpty(request)) { + return false; } - if (!isEmpty(notifications)) { - result.notifications = notifications; + if (isEmpty(response)) { + return false; } - return result; + return true; } - function buildRequest$1(request, params, data) { - const visitorValues = data[0]; - const providersValues = data[1]; - const providersParams = reactorObjectAssign({}, providersValues, params); - return createDeliveryRequest$1(request, visitorValues, providersParams); + function getServerState(config) { + return config[SERVER_STATE]; } - function createAsyncDeliveryRequest$1(request, params) { - return getAsyncThirdPartyData$1().then(data => buildRequest$1(request, params, data)); + function recordServerStateTelemetry(request) { + window.__target_telemetry.addServerStateEntry(request); } - function getTimeout$1(config, timeout) { - if (!isNumber(timeout)) { - return config[TIMEOUT]; + + const INIT = "[page-init]"; + function handleError(error) { + logWarn(INIT, VIEW_DELIVERY_ERROR, error); + publish(NO_OFFERS_EVENT); + addClientTrace({ + source: INIT, + error + }); + removeHidingSnippetStyle(); + } + function handleSuccess(response) { + let skipPrehiding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const options = { + selector: HEAD_TAG, + response + }; + logDebug(INIT, RESPONSE, response); + addClientTrace({ + source: INIT, + response + }); + executeApplyOffers(options, skipPrehiding)['catch'](handleError); + } + function scrubServerStateResponse(config, response) { + const result = reactorObjectAssign({}, response); + const { + execute, + prefetch + } = result; + const pageLoadEnabled = config[PAGE_LOAD_ENABLED]; + const viewsEnabled = config[VIEWS_ENABLED]; + if (execute) { + result.execute.mboxes = undefined; } - if (timeout < 0) { - return config[TIMEOUT]; + if (execute && !pageLoadEnabled) { + result.execute.pageLoad = undefined; } - return timeout; - } - function getServerDomain$1(config) { - const serverDomain = config[SERVER_DOMAIN]; - const overrideMboxEdgeServer = config[OVERRIDE_MBOX_EDGE_SERVER]; - if (!overrideMboxEdgeServer) { - return serverDomain; + if (prefetch) { + result.prefetch.mboxes = undefined; } - const cluster = getEdgeCluster(); - if (isBlank(cluster)) { - return serverDomain; + if (prefetch && !viewsEnabled) { + result.prefetch.views = undefined; } - return "" + EDGE_SERVER_PREFIX$1 + cluster + EDGE_SERVER_DOMAIN$1; + return result; } - function createRequestUrl$1(config) { - const scheme = config[SCHEME]; - const host = getServerDomain$1(config); - const path = config[ENDPOINT]; - const client = config[CLIENT_CODE]; - const sessionId = getSessionId(); - const version = config[VERSION]; - const queryString = stringifyQueryString({ - client, - sessionId, - version + function processServerState(config) { + const serverState = getServerState(config); + const { + request, + response + } = serverState; + const skipPrehiding = true; + logDebug(INIT, USING_SERVER_STATE); + addClientTrace({ + source: INIT, + serverState }); - return scheme + "//" + host + path + "?" + queryString; + const scrubbedResponse = scrubServerStateResponse(config, response); + hidePageLoadOptions(scrubbedResponse); + hideAllViews(scrubbedResponse); + recordServerStateTelemetry(request); + processResponse({ + request, + response: scrubbedResponse + }).then(res => handleSuccess(res, skipPrehiding))['catch'](handleError); } - function executeDeliveryRequest$1(request, requestTimeout) { + function initDecisioningEngine() { const config = getConfig(); - const url = createRequestUrl$1(config); - const headers = { - [CONTENT_TYPE]: [TEXT_PLAIN] - }; - const timeout = getTimeout$1(config, requestTimeout); - const async = true; - const options = { - url, - headers, - body: request, - timeout, - async - }; - return executeXhr(options).then(response => { - return reactorObjectAssign(response, { - decisioningMethod: DECISIONING_METHOD.SERVER_SIDE + bootstrapDecisioningEngine(config, executeBeaconNotification); + } + function initDelivery() { + if (!isDeliveryEnabled() && !isAuthoringEnabled()) { + logWarn(INIT, DELIVERY_DISABLED); + addClientTrace({ + source: INIT, + error: DELIVERY_DISABLED + }); + return; + } + const config = getConfig(); + if (hasServerState(config)) { + processServerState(config); + return; + } + const pageLoadEnabled = config[PAGE_LOAD_ENABLED]; + const viewsEnabled = config[VIEWS_ENABLED]; + if (!pageLoadEnabled && !viewsEnabled) { + logDebug(INIT, PAGE_LOAD_DISABLED); + addClientTrace({ + source: INIT, + error: PAGE_LOAD_DISABLED }); - }); - } - function prepareExecuteRequest(config, options, request, requestTimeout) { - const decisioningMethod = getDecisioningMethod(config, options); - if (!decisioningEngineRequired(config, options)) { - return executeDeliveryRequest$1(request, requestTimeout); + return; } - return ifOnDeviceDecisioningPossible(config).then(() => hasRemoteDependency$1(request)).then(dependency => { - if (decisioningMethod === DECISIONING_METHOD.HYBRID && dependency.remoteNeeded) { - return executeDeliveryRequest$1(request, requestTimeout); - } - return executeDecisioningRequest(request); - })['catch'](err => { - if (decisioningMethod === DECISIONING_METHOD.HYBRID) { - return executeDeliveryRequest$1(request, requestTimeout); - } - throw err; - }); - } - function executeRequest$1(options, request, requestTimeout) { - const config = getConfig(); - logDebug(REQUEST, request); + injectHidingSnippetStyle(); + const request = {}; + if (pageLoadEnabled) { + const execute = {}; + execute.pageLoad = {}; + request.execute = execute; + } + if (viewsEnabled) { + const prefetch = {}; + prefetch.views = [{}]; + request.prefetch = prefetch; + } + const timeout = config[TIMEOUT$1]; + logDebug(INIT, REQUEST, request); addClientTrace({ + source: INIT, request }); - return prepareExecuteRequest(config, options, request, requestTimeout).then(response => { - logDebug(RESPONSE, response); - addClientTrace({ - response - }); - return { - request, - response - }; - }); + const options = { + request, + timeout + }; + if (!shouldUseOptin() || isTargetApproved()) { + executeGetOffers(options).then(handleSuccess)['catch'](handleError); + return; + } + fetchOptinPermissions().then(() => { + executeGetOffers(options).then(handleSuccess)['catch'](handleError); + })['catch'](handleError); } - function handleRequestSuccess$1(response) { - const payload = createEventPayload(response); - const analyticsDetails = getAnalyticsDetails(response); - if (!isEmpty(analyticsDetails)) { - payload.analyticsDetails = analyticsDetails; - } - logDebug(REQUEST_SUCCEEDED, response); - notifyRequestSucceeded(payload, hasRedirect(response)); - return resolve$1(response); + function createValid() { + const result = {}; + result[VALID] = true; + return result; } - function handleMboxRequestSuccess(mbox, response) { - const payload = createEventPayload(response); - payload.mbox = mbox; - logDebug(REQUEST_SUCCEEDED, response); - notifyRequestSucceeded(payload, hasRedirect(response)); - return resolve$1(response); + function createInvalid(error) { + const result = {}; + result[VALID] = false; + result[ERROR] = error; + return result; } - function handleRequestError$1(error) { - logWarn(REQUEST_FAILED, error); - notifyRequestFailed({ - error - }); - return reject$1(error); + function validateMbox(mbox) { + if (isBlank(mbox)) { + return createInvalid(MBOX_REQUIRED); + } + if (mbox.length > MBOX_LENGTH) { + return createInvalid(MBOX_TOO_LONG); + } + return createValid(); } - function handleMboxRequestError(mbox, error) { - logWarn(REQUEST_FAILED, error); - notifyRequestFailed({ - mbox, - error - }); - return reject$1(error); + function validateGetOfferOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } + const mbox = options[MBOX]; + const mboxValidation = validateMbox(mbox); + if (!mboxValidation[VALID]) { + return mboxValidation; + } + if (!isFunction(options[SUCCESS])) { + return createInvalid(SUCCESS_REQUIRED); + } + if (!isFunction(options[ERROR])) { + return createInvalid(ERROR_REQUIRED); + } + return createValid(); } - function executeGetOffer(options) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; + function validateGetOffersOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } const { - mbox, - timeout + request } = options; - const params = isObject(options.params) ? options.params : {}; - const successFunc = response => handleMboxRequestSuccess(mbox, response); - const errorFunc = error => handleMboxRequestError(mbox, error); - const payload = {}; - const execute = {}; - if (mbox === globalMbox) { - execute.pageLoad = {}; - } else { - execute.mboxes = [{ - index: 0, - name: mbox - }]; + if (!isObject(request)) { + return createInvalid(REQUEST_REQUIRED); } - payload.execute = execute; - const analytics = createAnalytics$1(mbox, payload); - if (!isEmpty(analytics)) { - const experienceCloud = {}; - experienceCloud.analytics = analytics; - payload.experienceCloud = experienceCloud; + const { + execute, + prefetch + } = request; + if (!isObject(execute) && !isObject(prefetch)) { + return createInvalid(EXECUTE_OR_PREFETCH_REQUIRED); } - notifyRequestStart({ - mbox - }); - return createAsyncDeliveryRequest$1(payload, params).then(request => executeRequest$1(options, request, timeout)).then(processResponse).then(successFunc)['catch'](errorFunc); + return createValid(); } - function executeGetOffers$1(options) { - const config = getConfig(); - const globalMbox = config[GLOBAL_MBOX_NAME]; + function validateSendNotificationsOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } const { - consumerId = globalMbox, - request, - timeout + request } = options; - const analytics = createAnalytics$1(consumerId, request); - const successFunc = response => handleRequestSuccess$1(response); - const errorFunc = error => handleRequestError$1(error); - if (!isEmpty(analytics)) { - const experienceCloud = request.experienceCloud || {}; - experienceCloud.analytics = analytics; - request.experienceCloud = experienceCloud; + if (!isObject(request)) { + return createInvalid(REQUEST_REQUIRED); } - notifyRequestStart({}); - function measurePerf(response) { - return resolve$1(response); + const { + execute, + prefetch, + notifications + } = request; + if (isObject(execute) || isObject(prefetch)) { + return createInvalid(EXECUTE_OR_PREFETCH_NOT_ALLOWED); + } + if (!isArray$1(notifications)) { + return createInvalid(NOTIFICATIONS_REQUIRED); + } + return createValid(); + } + function validateApplyOfferOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } + const mbox = options[MBOX]; + const mboxValidation = validateMbox(mbox); + if (!mboxValidation[VALID]) { + return mboxValidation; + } + const offer = options[OFFER]; + if (!isArray$1(offer)) { + return createInvalid(OFFER_REQUIRED); + } + return createValid(); + } + function validateApplyOffersOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } + const { + response + } = options; + if (!isObject(response)) { + return createInvalid(RESPONE_REQUIRED); + } + return createValid(); + } + function validateTrackEventOptions(options) { + if (!isObject(options)) { + return createInvalid(OPTIONS_REQUIRED); + } + const mbox = options[MBOX]; + const mboxValidation = validateMbox(mbox); + if (!mboxValidation[VALID]) { + return mboxValidation; } - return createAsyncDeliveryRequest$1(request, {}).then(deliveryRequest => executeRequest$1(options, deliveryRequest, timeout)).then(processResponse).then(measurePerf).then(successFunc)['catch'](errorFunc); + return createValid(); } - function redirect$2(option) { + function redirect(option) { return { action: REDIRECT, url: option.content }; } - function setHtml$3(action) { + function setHtml(action) { const result = {}; result.action = SET_CONTENT; result.content = action.content; @@ -10681,7 +10978,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function setText$4(action) { + function setText(action) { const result = {}; result.action = SET_TEXT; result.content = action.content; @@ -10689,7 +10986,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function appendHtml$2(action) { + function appendHtml(action) { const result = {}; result.action = APPEND_CONTENT; result.content = action.content; @@ -10697,7 +10994,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function prependHtml$2(action) { + function prependHtml(action) { const result = {}; result.action = PREPEND_CONTENT; result.content = action.content; @@ -10705,7 +11002,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function replaceHtml$2(action) { + function replaceHtml(action) { const result = {}; result.action = REPLACE_CONTENT; result.content = action.content; @@ -10713,7 +11010,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function insertBefore$3(action) { + function insertBefore(action) { const result = {}; result.action = INSERT_BEFORE; result.content = action.content; @@ -10721,7 +11018,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function insertAfter$3(action) { + function insertAfter(action) { const result = {}; result.action = INSERT_AFTER; result.content = action.content; @@ -10729,7 +11026,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function customCode$3(action) { + function customCode(action) { const result = {}; result.action = CUSTOM_CODE; result.content = action.content; @@ -10737,7 +11034,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function setAttribute$3(action) { + function setAttribute(action) { const attribute = keys(action.content)[0]; const result = {}; result.action = SET_ATTRIBUTE; @@ -10747,7 +11044,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function setImageSource$2(action) { + function setImageSource(action) { const result = {}; result.action = SET_ATTRIBUTE; result.attribute = SRC; @@ -10756,7 +11053,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function setStyle$3(action) { + function setStyle(action) { const result = {}; result.action = SET_STYLE; result.style = action.content; @@ -10764,7 +11061,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function resize$2(action) { + function resize(action) { const result = {}; result.action = SET_STYLE; result.style = action.content; @@ -10772,7 +11069,7 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function move$2(action) { + function move(action) { const result = {}; result.action = SET_STYLE; result.style = action.content; @@ -10780,14 +11077,14 @@ window.adobe.target = (function () { result.cssSelector = action.cssSelector; return result; } - function remove$4(action) { + function remove(action) { const result = {}; result.action = REMOVE; result.selector = action.selector; result.cssSelector = action.cssSelector; return result; } - function rearrange$3(action) { + function rearrange(action) { const result = {}; result.action = REARRANGE; result.from = action.content.from; @@ -10804,58 +11101,58 @@ window.adobe.target = (function () { } = action; switch (type) { case SET_HTML: - result.push(setHtml$3(action)); + result.push(setHtml(action)); break; case SET_TEXT: - result.push(setText$4(action)); + result.push(setText(action)); break; case APPEND_HTML: - result.push(appendHtml$2(action)); + result.push(appendHtml(action)); break; case PREPEND_HTML: - result.push(prependHtml$2(action)); + result.push(prependHtml(action)); break; case REPLACE_HTML: - result.push(replaceHtml$2(action)); + result.push(replaceHtml(action)); break; case INSERT_BEFORE: - result.push(insertBefore$3(action)); + result.push(insertBefore(action)); break; case INSERT_AFTER: - result.push(insertAfter$3(action)); + result.push(insertAfter(action)); break; case CUSTOM_CODE: - result.push(customCode$3(action)); + result.push(customCode(action)); break; case SET_ATTRIBUTE: - result.push(setAttribute$3(action)); + result.push(setAttribute(action)); break; case SET_IMAGE_SOURCE: - result.push(setImageSource$2(action)); + result.push(setImageSource(action)); break; case SET_STYLE: - result.push(setStyle$3(action)); + result.push(setStyle(action)); break; case RESIZE: - result.push(resize$2(action)); + result.push(resize(action)); break; case MOVE: - result.push(move$2(action)); + result.push(move(action)); break; case REMOVE: - result.push(remove$4(action)); + result.push(remove(action)); break; case REARRANGE: - result.push(rearrange$3(action)); + result.push(rearrange(action)); break; case REDIRECT: - result.push(redirect$2(action)); + result.push(redirect(action)); break; } }, actions); return result; } - function processMetrics$2(metrics) { + function processMetrics(metrics) { if (isEmpty(metrics)) { return []; } @@ -10864,7 +11161,7 @@ window.adobe.target = (function () { if (m.type !== CLICK) { return; } - if (hasSelector(m)) { + if (hasSelector$1(m)) { result.push({ action: TRACK_CLICK, selector: m.selector, @@ -10902,7 +11199,7 @@ window.adobe.target = (function () { jsons.push(option.content); break; case REDIRECT: - actions.push(redirect$2(option)); + actions.push(redirect(option)); break; case ACTIONS: actions.push.apply(actions, processActions(option.content)); @@ -10921,7 +11218,7 @@ window.adobe.target = (function () { content: jsons }); } - const clickActions = processMetrics$2(metrics); + const clickActions = processMetrics(metrics); if (!isEmpty(clickActions)) { actions.push.apply(actions, clickActions); } @@ -10944,11 +11241,11 @@ window.adobe.target = (function () { } const GET_OFFER = "[getOffer()]"; - function handleRequestSuccess$2(options, response) { + function handleRequestSuccess(options, response) { const actions = convertToActions(response); options[SUCCESS](actions); } - function handleRequestError$2(options, error) { + function handleRequestError(options, error) { const status = error[STATUS] || UNKNOWN; options[ERROR](status, error); } @@ -10974,8 +11271,8 @@ window.adobe.target = (function () { }); return; } - const successFunc = response => handleRequestSuccess$2(options, response); - const errorFunc = err => handleRequestError$2(options, err); + const successFunc = response => handleRequestSuccess(options, response); + const errorFunc = err => handleRequestError(options, err); logDebug(GET_OFFER, options); addClientTrace({ source: GET_OFFER, @@ -11001,7 +11298,7 @@ window.adobe.target = (function () { options, error }); - return reject$1(validationResult); + return reject(validationResult); } if (!isDeliveryEnabled() && !isAuthoringEnabled()) { logWarn(GET_OFFERS, DELIVERY_DISABLED); @@ -11010,7 +11307,7 @@ window.adobe.target = (function () { options, error: DELIVERY_DISABLED }); - return reject$1(new Error(DELIVERY_DISABLED)); + return reject(new Error(DELIVERY_DISABLED)); } logDebug(GET_OFFERS, options); addClientTrace({ @@ -11018,14 +11315,16 @@ window.adobe.target = (function () { options }); if (!shouldUseOptin() || isTargetApproved()) { - return executeGetOffers$1(options); + return executeGetOffers(options); } - return fetchOptinPermissions().then(() => executeGetOffers$1(options)); + return fetchOptinPermissions().then(() => executeGetOffers(options)); } const APPLY_OFFER = "[applyOffer()]"; function applyOffer(options) { const selector = retrieveSelector(options.selector); + const entryId = hash(selector); + perfTool.timeStart(entryId); const validationResult = validateApplyOfferOptions(options); const error = validationResult[ERROR]; if (!validationResult[VALID]) { @@ -11055,11 +11354,16 @@ window.adobe.target = (function () { options }); executeApplyOffer(options); + const executionTime = perfTool.timeEnd(entryId); + perfTool.clearTiming(entryId); + window.__target_telemetry.addRenderEntry(entryId, executionTime); } const APPLY_OFFERS = "[applyOffers()]"; function applyOffers(options) { const selector = retrieveSelector(options.selector); + const entryId = hash(selector); + perfTool.timeStart(entryId); const validationResult = validateApplyOffersOptions(options); const error = validationResult[ERROR]; if (!validationResult[VALID]) { @@ -11070,7 +11374,7 @@ window.adobe.target = (function () { error }); showElement(selector); - return reject$1(validationResult); + return reject(validationResult); } if (!isDeliveryEnabled() && !isAuthoringEnabled()) { logWarn(APPLY_OFFERS, DELIVERY_DISABLED); @@ -11080,7 +11384,7 @@ window.adobe.target = (function () { error: DELIVERY_DISABLED }); showElement(selector); - return reject$1(new Error(DELIVERY_DISABLED)); + return reject(new Error(DELIVERY_DISABLED)); } options.selector = selector; logDebug(APPLY_OFFERS, options); @@ -11088,7 +11392,11 @@ window.adobe.target = (function () { source: APPLY_OFFERS, options }); - return executeApplyOffers(options); + return executeApplyOffers(options).then(() => { + const executionTime = perfTool.timeEnd(entryId); + perfTool.clearTiming(entryId); + window.__target_telemetry.addRenderEntry(entryId, executionTime); + }); } const SEND_NOTIFICATIONS = "[sendNotifications()]"; @@ -11141,9 +11449,9 @@ window.adobe.target = (function () { const result = reactorObjectAssign({}, options); const optsParams = isObject(options.params) ? options.params : {}; result[PARAMS] = reactorObjectAssign({}, getTargetPageParams(mbox), optsParams); - result[TIMEOUT] = getTimeout(config, options[TIMEOUT]); - result[SUCCESS] = isFunction(options[SUCCESS]) ? options[SUCCESS] : noop; - result[ERROR] = isFunction(options[ERROR]) ? options[ERROR] : noop; + result[TIMEOUT$1] = getTimeout(config, options[TIMEOUT$1]); + result[SUCCESS] = isFunction(options[SUCCESS]) ? options[SUCCESS] : noop$1; + result[ERROR] = isFunction(options[ERROR]) ? options[ERROR] : noop$1; return result; } function shouldTrackBySelector(options) { @@ -11341,24 +11649,90 @@ window.adobe.target = (function () { logWarn(MBOX_UPDATE_WARN, arguments); } + const INDEX_START_VALUE = -1; + const BASE_10 = 10; + const TELEMETRY_TOKEN = "tlm"; + const TELEMETRY_STORAGE_PREFIX = TARGET_STORAGE_PREFIX + ":" + TELEMETRY_TOKEN; + const LOWER_BOUND_INDEX_KEY = TELEMETRY_STORAGE_PREFIX + ":lower"; + const UPPER_BOUND_INDEX_KEY = TELEMETRY_STORAGE_PREFIX + ":upper"; + function LocalStorageTelemetryStore() { + function getTelemetryCacheKey(index) { + return TELEMETRY_STORAGE_PREFIX + ":" + index; + } + function getIndex(key) { + const indexStr = localStorage.getItem(key); + let index = parseInt(indexStr, BASE_10); + if (Number.isNaN(index)) { + index = INDEX_START_VALUE; + } + return index; + } + function setIndex(key, index) { + localStorage.setItem(key, index); + } + function incrementIndex() { + const index = getIndex(UPPER_BOUND_INDEX_KEY) + 1; + setIndex(UPPER_BOUND_INDEX_KEY, index); + return index; + } + function setTelemetryEntry(index, entry) { + storeJsonInLocalStorage(getTelemetryCacheKey(index), entry); + } + function popTelemetryEntry(index) { + const key = getTelemetryCacheKey(index); + const item = localStorage.getItem(key); + localStorage.removeItem(key); + return item; + } + function getAndClearAllTelemetryEntries() { + const entries = []; + const lowerBoundIndex = getIndex(LOWER_BOUND_INDEX_KEY) || INDEX_START_VALUE; + const upperBoundIndex = getIndex(UPPER_BOUND_INDEX_KEY) || INDEX_START_VALUE; + for (let i = upperBoundIndex; i > lowerBoundIndex; i -= 1) { + const entry = popTelemetryEntry(i); + if (entry) { + entries.push(JSON.parse(entry)); + } + } + setIndex(LOWER_BOUND_INDEX_KEY, upperBoundIndex); + return entries; + } + function addEntry(entry) { + const index = incrementIndex(); + setTelemetryEntry(index, entry); + } + function getAndClearEntries() { + return getAndClearAllTelemetryEntries(); + } + function hasEntries() { + const mostRecentKey = getTelemetryCacheKey(getIndex(UPPER_BOUND_INDEX_KEY)); + return !!localStorage.getItem(mostRecentKey); + } + return { + addEntry, + getAndClearEntries, + hasEntries + }; + } + function overridePublicApi(win) { win.adobe = win.adobe || {}; win.adobe.target = { VERSION: "", event: {}, - getOffer: noop, + getOffer: noop$1, getOffers: noopPromise, - applyOffer: noop, + applyOffer: noop$1, applyOffers: noopPromise, - sendNotifications: noop, - trackEvent: noop, - triggerView: noop, - registerExtension: noop, - init: noop + sendNotifications: noop$1, + trackEvent: noop$1, + triggerView: noop$1, + registerExtension: noop$1, + init: noop$1 }; - win.mboxCreate = noop; - win.mboxDefine = noop; - win.mboxUpdate = noop; + win.mboxCreate = noop$1; + win.mboxDefine = noop$1; + win.mboxUpdate = noop$1; } function init(win, doc, settings) { if (win.adobe && win.adobe.target && typeof win.adobe.target.getOffer !== "undefined") { @@ -11372,8 +11746,8 @@ window.adobe.target = (function () { win.adobe.target.event = { LIBRARY_LOADED, REQUEST_START, - REQUEST_SUCCEEDED: REQUEST_SUCCEEDED$1, - REQUEST_FAILED: REQUEST_FAILED$1, + REQUEST_SUCCEEDED, + REQUEST_FAILED, CONTENT_RENDERING_START, CONTENT_RENDERING_SUCCEEDED, CONTENT_RENDERING_FAILED, @@ -11388,6 +11762,7 @@ window.adobe.target = (function () { logWarn(DELIVERY_DISABLED); return; } + win.__target_telemetry = TelemetryProvider(config[TELEMETRY_ENABLED_SETTING] && localStorageAvailable(), config[DECISIONING_METHOD_SETTING], LocalStorageTelemetryStore()); initTraces(); initAuthoringCode(); initQaMode(win); @@ -11413,7 +11788,7 @@ window.adobe.target = (function () { return bootstrapOdd; -}()); +})(); window.adobe.target.init(window, document, { "clientCode": "demo", "imsOrgId": "", diff --git a/react-shopping-cart-demo/public/at.js b/react-shopping-cart-demo/public/at.js new file mode 100644 index 0000000..758b149 --- /dev/null +++ b/react-shopping-cart-demo/public/at.js @@ -0,0 +1,9015 @@ +/** + * @license + * at.js 2.8.2 | (c) Adobe Systems Incorporated | All rights reserved + * zepto.js | (c) 2010-2016 Thomas Fuchs | zeptojs.com/license +*/ +window.adobe = window.adobe || {}; +window.adobe.target = (function () { + 'use strict'; + + // This is used to make RequireJS happy + var define; + var _win = window; + var _doc = document; + var _isIE11OrModernBrowser = _doc.documentMode ? _doc.documentMode >= 11 : true; + var _isStandardMode = _doc.compatMode && _doc.compatMode === "CSS1Compat"; + + function isIE() { + var ua = window.navigator.userAgent; + var ie10orOlder = ua.indexOf("MSIE ") > 0; + var ie11 = ua.indexOf("Trident/") > 0; + + return ie10orOlder || ie11; + } + + var _isEnabled = _isStandardMode && _isIE11OrModernBrowser && !isIE(); + var _globalSettings = _win.targetGlobalSettings; + + if (!_isEnabled || (_globalSettings && _globalSettings.enabled === false)) { + _win.adobe = _win.adobe || {}; + _win.adobe.target = { + VERSION: "", + event: {}, + getOffer: noop, + getOffers: noopPromise, + applyOffer: noop, + applyOffers: noopPromise, + sendNotifications: noopPromise, + trackEvent: noop, + triggerView: noop, + registerExtension: noop, + init: noop + }; + _win.mboxCreate = noop; + _win.mboxDefine = noop; + _win.mboxUpdate = noop; + + if ("console" in _win && "warn" in _win.console) { + _win.console.warn( + "AT: Adobe Target content delivery is disabled. Update your DOCTYPE to support Standards mode." + ); + } + + return _win.adobe.target; + } + + + var commonjsGlobal$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var a = Object.defineProperty({}, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; + } + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty$2 = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + return Object(val); + } + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + var test1 = new String('abc'); + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + return true; + } catch (err) { + return false; + } + } + var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + for (var key in from) { + if (hasOwnProperty$2.call(from, key)) { + to[key] = from[key]; + } + } + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + return to; + }; + + var reactorObjectAssign = objectAssign; + + function isNil(value) { + return value == null; + } + const { + isArray: isArray$1 + } = Array; + const { + prototype: objectProto + } = Object; + const { + toString: nativeObjectToString + } = objectProto; + function objectToString(value) { + return nativeObjectToString.call(value); + } + function baseGetTag(value) { + return objectToString(value); + } + function isObject(value) { + const type = typeof value; + const notNull = value != null; + return notNull && (type === "object" || type === "function"); + } + const funcTag = "[object Function]"; + function isFunction(value) { + if (!isObject(value)) { + return false; + } + return baseGetTag(value) === funcTag; + } + function identity(value) { + return value; + } + function castFunction(value) { + return isFunction(value) ? value : identity; + } + function keys(object) { + if (isNil(object)) { + return []; + } + return Object.keys(object); + } + const arrayEach = (iteratee, collection) => collection.forEach(iteratee); + const baseEach = (iteratee, collection) => { + arrayEach(key => iteratee(collection[key], key), keys(collection)); + }; + const arrayFilter = (predicate, collection) => collection.filter(predicate); + const baseFilter = (predicate, collection) => { + const result = {}; + baseEach((value, key) => { + if (predicate(value, key)) { + result[key] = value; + } + }, collection); + return result; + }; + function filter(predicate, collection) { + if (isNil(collection)) { + return []; + } + const func = isArray$1(collection) ? arrayFilter : baseFilter; + return func(castFunction(predicate), collection); + } + function first(array) { + return array && array.length ? array[0] : undefined; + } + function flatten(array) { + if (isNil(array)) { + return []; + } + return [].concat.apply([], array); + } + function flow(funcs) { + var _this = this; + const length = funcs ? funcs.length : 0; + let index = length; + while (index -= 1) { + if (!isFunction(funcs[index])) { + throw new TypeError("Expected a function"); + } + } + return function () { + let i = 0; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + let result = length ? funcs[i].apply(_this, args) : args[0]; + while ((i += 1) < length) { + result = funcs[i].call(_this, result); + } + return result; + }; + } + function forEach(iteratee, collection) { + if (isNil(collection)) { + return; + } + const func = isArray$1(collection) ? arrayEach : baseEach; + func(castFunction(iteratee), collection); + } + function isObjectLike(value) { + const notNull = value != null; + return notNull && typeof value === "object"; + } + const stringTag = "[object String]"; + function isString(value) { + return typeof value === "string" || !isArray$1(value) && isObjectLike(value) && baseGetTag(value) === stringTag; + } + function hash(string) { + if (!isString(string)) { + return -1; + } + let result = 0; + const { + length + } = string; + for (let i = 0; i < length; i += 1) { + result = (result << 5) - result + string.charCodeAt(i) & 0xffffffff; + } + return result; + } + const MAX_SAFE_INTEGER = 9007199254740991; + function isLength(value) { + return typeof value === "number" && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER; + } + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + const arrayMap = (iteratee, collection) => collection.map(iteratee); + function baseValues(props, object) { + return arrayMap(key => object[key], props); + } + function copyArray(source) { + let index = 0; + const { + length + } = source; + const array = Array(length); + while (index < length) { + array[index] = source[index]; + index += 1; + } + return array; + } + function stringToArray(str) { + return str.split(""); + } + function toArray(value) { + if (isNil(value)) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + return baseValues(keys(value), value); + } + const { + prototype: objectProto$1 + } = Object; + const { + hasOwnProperty: hasOwnProperty$1 + } = objectProto$1; + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike(value) && (isArray$1(value) || isString(value) || isFunction(value.splice))) { + return !value.length; + } + for (const key in value) { + if (hasOwnProperty$1.call(value, key)) { + return false; + } + } + return true; + } + const { + prototype: stringProto + } = String; + const { + trim: nativeStringTrim + } = stringProto; + function trim(string) { + return isNil(string) ? "" : nativeStringTrim.call(string); + } + function isBlank(value) { + return isString(value) ? !trim(value) : isEmpty(value); + } + const isNotBlank = value => !isBlank(value); + const numberTag = "[object Number]"; + function isNumber(value) { + return typeof value === "number" || isObjectLike(value) && baseGetTag(value) === numberTag; + } + const objectTag = "[object Object]"; + const { + prototype: funcProto + } = Function; + const { + prototype: objectProto$2 + } = Object; + const { + toString: funcToString + } = funcProto; + const { + hasOwnProperty: hasOwnProperty$1$1 + } = objectProto$2; + const objectCtorString = funcToString.call(Object); + function getPrototype(value) { + return Object.getPrototypeOf(Object(value)); + } + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { + return false; + } + const proto = getPrototype(value); + if (proto === null) { + return true; + } + const Ctor = hasOwnProperty$1$1.call(proto, "constructor") && proto.constructor; + return typeof Ctor === "function" && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString; + } + function join(joiner, collection) { + if (!isArray$1(collection)) { + return ""; + } + return collection.join(joiner || ""); + } + const baseMap = (iteratee, collection) => { + const result = {}; + baseEach((value, key) => { + result[key] = iteratee(value, key); + }, collection); + return result; + }; + function map(iteratee, collection) { + if (isNil(collection)) { + return []; + } + const func = isArray$1(collection) ? arrayMap : baseMap; + return func(castFunction(iteratee), collection); + } + function now() { + return new Date().getTime(); + } + const arrayReduce = (iteratee, accumulator, collection) => collection.reduce(iteratee, accumulator); + const baseReduce = (iteratee, accumulator, collection) => { + let localAcc = accumulator; + baseEach((value, key) => { + localAcc = iteratee(localAcc, value, key); + }, collection); + return localAcc; + }; + function reduce(iteratee, accumulator, collection) { + if (isNil(collection)) { + return accumulator; + } + const func = isArray$1(collection) ? arrayReduce : baseReduce; + return func(castFunction(iteratee), accumulator, collection); + } + const { + prototype: arrayProto + } = Array; + const { + reverse: nativeReverse + } = arrayProto; + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + function split(separator, string) { + if (isBlank(string)) { + return []; + } + return string.split(separator || ""); + } + function delay(func) { + let wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return setTimeout(func, Number(wait) || 0); + } + function cancelDelay(id) { + clearTimeout(id); + } + const DECISIONING_METHOD = { + ON_DEVICE: "on-device", + SERVER_SIDE: "server-side", + HYBRID: "hybrid" + }; + const EXECUTION_MODE = { + EDGE: "edge", + LOCAL: "local" + }; + function isUndefined(value) { + return typeof value === "undefined"; + } + function isDefined(value) { + return !isUndefined(value); + } + const noop$1 = () => undefined; + const noopPromise = value => Promise.resolve(value); + function isExecutePageLoad(request) { + return !!request.execute && !!request.execute.pageLoad; + } + function executeMboxCount(request) { + return !!request.execute && !!request.execute.mboxes && request.execute.mboxes.length || 0; + } + function isPrefetchPageLoad(request) { + return !!request.prefetch && !!request.prefetch.pageLoad; + } + function prefetchMboxCount(request) { + return !!request.prefetch && !!request.prefetch.mboxes && request.prefetch.mboxes.length || 0; + } + function prefetchViewCount(request) { + return !!request.prefetch && !!request.prefetch.views && request.prefetch.views.length || 0; + } + function formatDecimal(value) { + let digits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2; + if (!value || !isNumber(value)) { + return undefined; + } + return +value.toFixed(digits); + } + function InMemoryTelemetryStore() { + let telemetryEntries = []; + function addEntry(entry) { + telemetryEntries.push(entry); + } + function getAndClearEntries() { + const allEntries = telemetryEntries; + telemetryEntries = []; + return allEntries; + } + function hasEntries() { + return telemetryEntries.length > 0; + } + return { + addEntry, + getAndClearEntries, + hasEntries + }; + } + const STATUS_OK = 200; + function TelemetryProvider() { + let telemetryEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + let method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DECISIONING_METHOD.SERVER_SIDE; + let telemetryStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : InMemoryTelemetryStore(); + function getMode(status, decisioningMethod) { + if (status === STATUS_OK && (decisioningMethod === DECISIONING_METHOD.ON_DEVICE || decisioningMethod === DECISIONING_METHOD.HYBRID)) { + return EXECUTION_MODE.LOCAL; + } + return EXECUTION_MODE.EDGE; + } + function getFeatures(request) { + const features = {}; + const executePageLoad = isExecutePageLoad(request); + const executeMbox = executeMboxCount(request); + const prefetchPageLoad = isPrefetchPageLoad(request); + const prefetchMbox = prefetchMboxCount(request); + const prefetchView = prefetchViewCount(request); + if (executePageLoad) { + features.executePageLoad = executePageLoad; + } + if (executeMbox) { + features.executeMboxCount = executeMbox; + } + if (prefetchPageLoad) { + features.prefetchPageLoad = prefetchPageLoad; + } + if (prefetchMbox) { + features.prefetchMboxCount = prefetchMbox; + } + if (prefetchView) { + features.prefetchViewCount = prefetchView; + } + return features; + } + function normalizeEntryRequest(entryRequest) { + const normalized = {}; + if (entryRequest.dns) { + normalized.dns = formatDecimal(entryRequest.dns); + } + if (entryRequest.tls) { + normalized.tls = formatDecimal(entryRequest.tls); + } + if (entryRequest.timeToFirstByte) { + normalized.timeToFirstByte = formatDecimal(entryRequest.timeToFirstByte); + } + if (entryRequest.download) { + normalized.download = formatDecimal(entryRequest.download); + } + if (entryRequest.responseSize) { + normalized.responseSize = formatDecimal(entryRequest.responseSize); + } + return normalized; + } + function normalizeEntry(entry) { + const normalized = {}; + if (entry.execution) { + normalized.execution = formatDecimal(entry.execution); + } + if (entry.parsing) { + normalized.parsing = formatDecimal(entry.parsing); + } + if (entry.request) { + normalized.request = normalizeEntryRequest(entry.request); + } + return reactorObjectAssign(entry, normalized); + } + function normalizeAndAddEntry(entry) { + telemetryStore.addEntry(normalizeEntry(entry)); + } + function addServerStateEntry(request) { + if (!telemetryEnabled) { + return; + } + normalizeAndAddEntry({ + requestId: request.requestId, + timestamp: now() + }); + } + function addRenderEntry(renderId, execution) { + if (!telemetryEnabled) { + return; + } + normalizeAndAddEntry({ + requestId: renderId, + timestamp: now(), + execution + }); + } + function addRequestEntry(requestId, entry) { + const requestEntry = reactorObjectAssign(entry, { + requestId, + timestamp: now() + }); + normalizeAndAddEntry(requestEntry); + } + function addArtifactRequestEntry(requestId, entry) { + if (!telemetryEnabled || !entry) { + return; + } + addRequestEntry(requestId, entry); + } + function addDeliveryRequestEntry(request, entry, status) { + let decisioningMethod = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : method; + if (!telemetryEnabled || !entry) { + return; + } + const { + requestId + } = request; + const features = reactorObjectAssign(getFeatures(request), { + decisioningMethod + }); + const baseEntry = { + mode: getMode(status, decisioningMethod), + features + }; + const deliveryRequestEntry = reactorObjectAssign(entry, baseEntry); + addRequestEntry(requestId, deliveryRequestEntry); + } + function getAndClearEntries() { + return telemetryStore.getAndClearEntries(); + } + function hasEntries() { + return telemetryStore.hasEntries(); + } + function addTelemetryToDeliveryRequest(deliveryRequest) { + if (hasEntries()) { + return reactorObjectAssign(deliveryRequest, { + telemetry: { + entries: getAndClearEntries() + } + }); + } + return deliveryRequest; + } + return { + addDeliveryRequestEntry, + addArtifactRequestEntry, + addRenderEntry, + addServerStateEntry, + getAndClearEntries, + hasEntries, + addTelemetryToDeliveryRequest + }; + } + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + function createCommonjsModule(fn, module) { + return module = { + exports: {} + }, fn(module, module.exports), module.exports; + } + var performanceNow = createCommonjsModule(function (module) { + (function () { + var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; + if (typeof performance !== "undefined" && performance !== null && performance.now) { + module.exports = function () { + return performance.now(); + }; + } else if (typeof process !== "undefined" && process !== null && process.hrtime) { + module.exports = function () { + return (getNanoSeconds() - nodeLoadTime) / 1e6; + }; + hrtime = process.hrtime; + getNanoSeconds = function () { + var hr; + hr = hrtime(); + return hr[0] * 1e9 + hr[1]; + }; + moduleLoadTime = getNanoSeconds(); + upTime = process.uptime() * 1e9; + nodeLoadTime = moduleLoadTime - upTime; + } else if (Date.now) { + module.exports = function () { + return Date.now() - loadTime; + }; + loadTime = Date.now(); + } else { + module.exports = function () { + return new Date().getTime() - loadTime; + }; + loadTime = new Date().getTime(); + } + }).call(commonjsGlobal); + }); + function createPerfToolInstance() { + let timingIds = {}; + let startTimes = {}; + let timings = {}; + function getUniqueTimingId(id) { + const count = (isDefined(timingIds[id]) ? timingIds[id] : 0) + 1; + timingIds[id] = count; + return "" + id + count; + } + function timeStart(id) { + let incrementTimer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + const timingId = incrementTimer ? getUniqueTimingId(id) : id; + if (isUndefined(startTimes[timingId])) { + startTimes[timingId] = performanceNow(); + } + return timingId; + } + function timeEnd(id) { + let offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + if (isUndefined(startTimes[id])) { + return -1; + } + const timing = performanceNow() - startTimes[id] - offset; + timings[id] = timing; + return timing; + } + function clearTiming(id) { + delete timingIds[id]; + delete startTimes[id]; + delete timings[id]; + } + function reset() { + timingIds = {}; + startTimes = {}; + timings = {}; + } + return { + timeStart, + timeEnd, + getTimings: () => timings, + getTiming: key => timings[key], + clearTiming, + reset + }; + } + const perfTool = createPerfToolInstance(); + function parseURI(str, opts) { + if (!str) return undefined; + opts = opts || {}; + var o = { + key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'], + q: { + name: 'queryKey', + parser: /(?:^|&)([^&=]*)=?([^&]*)/g + }, + parser: { + strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, + loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ + } + }; + var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str); + var uri = {}; + var i = 14; + while (i--) uri[o.key[i]] = m[i] || ''; + uri[o.q.name] = {}; + uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { + if ($1) uri[o.q.name][$1] = $2; + }); + return uri; + } + var parseUri$1 = parseURI; + function getRandomValues() { + const crypto = window.crypto || window.msCrypto; + return !isNil(crypto) && crypto.getRandomValues && isFunction(crypto.getRandomValues) && crypto.getRandomValues.bind(crypto); + } + const BUFFER = new Uint8Array(256); + const GET_RANDOM_VALUES = getRandomValues(); + function rng() { + return GET_RANDOM_VALUES(BUFFER); + } + function createByteToHex() { + const result = []; + for (let i = 0; i < 256; i += 1) { + result.push((i + 0x100).toString(16).substr(1)); + } + return result; + } + const BYTE_TO_HEX = createByteToHex(); + function stringify$1(arr) { + const result = []; + for (let i = 0; i < 16; i += 1) { + result.push(BYTE_TO_HEX[arr[i]]); + } + return join("", result).toLowerCase(); + } + function v4(rng) { + const buffer = rng(); + buffer[6] = buffer[6] & 0x0f | 0x40; + buffer[8] = buffer[8] & 0x3f | 0x80; + return stringify$1(buffer); + } + function uuid() { + return v4(rng); + } + + const TYPE = "type"; + const CONTENT = "content"; + const HEIGHT = "height"; + const WIDTH = "width"; + const LEFT = "left"; + const TOP = "top"; + const FROM = "from"; + const TO = "to"; + const PRIORITY = "priority"; + const SELECTOR = "selector"; + const CSS_SELECTOR = "cssSelector"; + const SET_HTML = "setHtml"; + const SET_CONTENT = "setContent"; + const SET_TEXT = "setText"; + const SET_JSON = "setJson"; + const SET_ATTRIBUTE = "setAttribute"; + const SET_IMAGE_SOURCE = "setImageSource"; + const SET_STYLE = "setStyle"; + const REARRANGE = "rearrange"; + const RESIZE = "resize"; + const MOVE = "move"; + const REMOVE = "remove"; + const CUSTOM_CODE = "customCode"; + const REDIRECT = "redirect"; + const TRACK_CLICK = "trackClick"; + const SIGNAL_CLICK = "signalClick"; + const INSERT_BEFORE = "insertBefore"; + const INSERT_AFTER = "insertAfter"; + const APPEND_HTML = "appendHtml"; + const APPEND_CONTENT = "appendContent"; + const PREPEND_HTML = "prependHtml"; + const PREPEND_CONTENT = "prependContent"; + const REPLACE_HTML = "replaceHtml"; + const REPLACE_CONTENT = "replaceContent"; + const DEBUG = "mboxDebug"; + const DISABLE = "mboxDisable"; + const AUTHORING = "mboxEdit"; + const CHECK = "at_check"; + const TRUE = "true"; + const MBOX_LENGTH = 250; + const DATA_SRC = "data-at-src"; + const JSON$1 = "json"; + const HTML = "html"; + const DYNAMIC = "dynamic"; + const SCRIPT = "script"; + const SRC = "src"; + const ID = "id"; + const CLASS = "class"; + const CLICK = "click"; + const HEAD_TAG = "head"; + const SCRIPT_TAG = "script"; + const STYLE_TAG = "style"; + const LINK_TAG = "link"; + const IMAGE_TAG = "img"; + const DIV_TAG = "div"; + const DELIVERY_DISABLED = 'Adobe Target content delivery is disabled. Ensure that you can save cookies to your current domain, there is no "mboxDisable" cookie and there is no "mboxDisable" parameter in query string.'; + const ALREADY_INITIALIZED = "Adobe Target has already been initialized."; + const OPTIONS_REQUIRED = "options argument is required"; + const REQUEST_REQUIRED = "request option is required"; + const RESPONE_REQUIRED = "response option is required"; + const EXECUTE_OR_PREFETCH_REQUIRED = "execute or prefetch is required"; + const EXECUTE_OR_PREFETCH_NOT_ALLOWED = "execute or prefetch is not allowed"; + const NOTIFICATIONS_REQUIRED = "notifications are required"; + const MBOX_REQUIRED = "mbox option is required"; + const MBOX_TOO_LONG = "mbox option is too long"; + const SUCCESS_REQUIRED = "success option is required"; + const ERROR_REQUIRED = "error option is required"; + const OFFER_REQUIRED = "offer option is required"; + const UNEXPECTED_ERROR = "Unexpected error"; + const REQUEST_FAILED$1 = "request failed"; + const REQUEST_SUCCEEDED$1 = "request succeeded"; + const ACTION_RENDERED = "Action rendered successfully"; + const ACTION_RENDERING = "Rendering action"; + const EMPTY_CONTENT = "Action has no content"; + const EMPTY_ATTRIBUTE = "Action has no attributes"; + const EMPTY_PROPERTY = "Action has no CSS properties"; + const EMPTY_SIZES = "Action has no height or width"; + const EMPTY_COORDINATES = "Action has no left, top or position"; + const EMPTY_REARRANGE = "Action has no from or to"; + const EMPTY_URL = "Action has no url"; + const EMPTY_IMAGE_URL = "Action has no image url"; + const REARRANGE_MISSING = "Rearrange elements are missing"; + const REARRANGE_INCORRECT_INDEXES = "Rearrange has incorrect \"from\" and \"to\" indexes"; + const LOADING_IMAGE = "Loading image"; + const TRACK_EVENT_SUCCESS = "Track event request succeeded"; + const TRACK_EVENT_ERROR = "Track event request failed"; + const NO_ACTIONS = "No actions to be rendered"; + const REDIRECT_ACTION = "Redirect action"; + const REMOTE_SCRIPT = "Script load"; + const ERROR = "error"; + const WARNING = "warning"; + const UNKNOWN = "unknown"; + const VALID = "valid"; + const SUCCESS = "success"; + const RENDER = "render"; + const METRIC = "metric"; + const MBOX = "mbox"; + const OFFER = "offer"; + const NAME = "name"; + const STATUS = "status"; + const PARAMS = "params"; + const ACTIONS = "actions"; + const RESPONSE_TOKENS = "responseTokens"; + const DATA$1 = "data"; + const RESPONSE = "response"; + const REQUEST = "request"; + const PROVIDER = "provider"; + const PAGE_LOAD$1 = "pageLoad"; + const FLICKER_CONTROL_CLASS = "at-flicker-control"; + const MARKER_CSS_CLASS = "at-element-marker"; + const CLICK_TRACKING_CSS_CLASS = "at-element-click-tracking"; + const ENABLED = "enabled"; + const CLIENT_CODE = "clientCode"; + const IMS_ORG_ID = "imsOrgId"; + const SERVER_DOMAIN = "serverDomain"; + const TIMEOUT$1 = "timeout"; + const GLOBAL_MBOX_NAME = "globalMboxName"; + const GLOBAL_MBOX_AUTO_CREATE = "globalMboxAutoCreate"; + const VERSION = "version"; + const DEFAULT_CONTENT_HIDDEN_STYLE = "defaultContentHiddenStyle"; + const DEFAULT_CONTENT_VISIBLE_STYLE = "defaultContentVisibleStyle"; + const BODY_HIDDEN_STYLE = "bodyHiddenStyle"; + const BODY_HIDING_ENABLED = "bodyHidingEnabled"; + const DEVICE_ID_LIFETIME = "deviceIdLifetime"; + const SESSION_ID_LIFETIME = "sessionIdLifetime"; + const SELECTORS_POLLING_TIMEOUT = "selectorsPollingTimeout"; + const VISITOR_API_TIMEOUT = "visitorApiTimeout"; + const OVERRIDE_MBOX_EDGE_SERVER = "overrideMboxEdgeServer"; + const OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT = "overrideMboxEdgeServerTimeout"; + const OPTOUT_ENABLED = "optoutEnabled"; + const SECURE_ONLY = "secureOnly"; + const SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT = "supplementalDataIdParamTimeout"; + const AUTHORING_SCRIPT_URL = "authoringScriptUrl"; + const SCHEME = "scheme"; + const COOKIE_DOMAIN = "cookieDomain"; + const MBOX_PARAMS = "mboxParams"; + const GLOBAL_MBOX_PARAMS = "globalMboxParams"; + const URL_SIZE_LIMIT = "urlSizeLimit"; + const SESSION_ID_PARAM = "mboxSession"; + const DEVICE_ID_COOKIE = "PC"; + const EDGE_CLUSTER_COOKIE = "mboxEdgeCluster"; + const SESSION_ID_COOKIE = "session"; + const TRACES_SUFFIX = "Traces"; + const SETTINGS = "settings"; + const CLIENT_TRACES = "client" + TRACES_SUFFIX; + const SERVER_TRACES = "server" + TRACES_SUFFIX; + const TRACES = "___target_traces"; + const GLOBAL_SETTINGS = "targetGlobalSettings"; + const DATA_PROVIDER = "dataProvider"; + const DATA_PROVIDERS = DATA_PROVIDER + "s"; + const ENDPOINT = "endpoint"; + const VIEWS_ENABLED = "viewsEnabled"; + const PAGE_LOAD_ENABLED = "pageLoadEnabled"; + const AUTH_STATE = "authState"; + const AUTHENTICATED_STATE = "authenticatedState"; + const INTEGRATION_CODE = "integrationCode"; + const PRIMARY = "primary"; + const PAGE = "page"; + const VIEW = "view"; + const VIEWS = "views"; + const OPTIONS = "options"; + const METRICS = "metrics"; + const EVENT_TOKEN = "eventToken"; + const VIEW_NAME = "viewName"; + const DISPLAY_EVENT = "display"; + const CONTENT_TYPE = "Content-Type"; + const TEXT_PLAIN = "text/plain"; + const RENDERING_VIEW_FAILED = "View rendering failed"; + const VIEW_DELIVERY_ERROR = "View delivery error"; + const VIEW_NAME_ERROR = "View name should be a non-empty string"; + const VIEWS_DISABLED = "Views are not enabled"; + const PAGE_LOAD_DISABLED = "Page load disabled"; + const USING_SERVER_STATE = "Using server state"; + const ADOBE = "adobe"; + const OPTIN = "optIn"; + const IS_APPROVED = "isApproved"; + const FETCH_PERMISSIONS = "fetchPermissions"; + const CATEGORIES = "Categories"; + const TARGET = "TARGET"; + const ANALYTICS = "ANALYTICS"; + const OPTIN_ENABLED = "optinEnabled"; + const ERROR_TARGET_NOT_OPTED_IN = "Adobe Target is not opted in"; + const ANALYTICS_LOGGING = "analyticsLogging"; + const SERVER_STATE = "serverState"; + const CSP_SCRIPT_NONCE = "cspScriptNonce"; + const CSP_STYLE_NONCE = "cspStyleNonce"; + const CACHE_UPDATED_EVENT = "cache-updated-event"; + const NO_OFFERS_EVENT = "no-offers-event"; + const REDIRECT_OFFER_EVENT = "redirect-offer-event"; + const SAMESITE_NONE = "None"; + const DECISIONING_METHOD_SETTING = "decisioningMethod"; + const POLLING_INTERVAL_SETTING = "pollingInterval"; + const ARTIFACT_LOCATION_SETTING = "artifactLocation"; + const ARTIFACT_FORMAT_SETTING = "artifactFormat"; + const ARTIFACT_PAYLOAD_SETTING = "artifactPayload"; + const TARGET_ENVIRONMENT_SETTING = "environment"; + const CDN_ENVIRONMENT_SETTING = "cdnEnvironment"; + const TELEMETRY_ENABLED_SETTING = "telemetryEnabled"; + const CDN_BASEPATH_SETTING = "cdnBasePath"; + const WEB_CHANNEL = "web"; + + var document$1 = document; + + var window$1 = window; + + const FILE_PROTOCOL = "file:"; + const IP_V4_REGEX = /^(?!0)(?!.*\.$)((1?\d?\d|25[0-5]|2[0-4]\d)(\.|$)){4}$/; + const STANDARD_DOMAIN_REGEX = /^(com|edu|gov|net|mil|org|nom|co|name|info|biz)$/i; + let config = {}; + const OVERRIDABLE_SETTINGS = [ENABLED, CLIENT_CODE, IMS_ORG_ID, SERVER_DOMAIN, COOKIE_DOMAIN, TIMEOUT$1, MBOX_PARAMS, GLOBAL_MBOX_PARAMS, DEFAULT_CONTENT_HIDDEN_STYLE, DEFAULT_CONTENT_VISIBLE_STYLE, DEVICE_ID_LIFETIME, BODY_HIDDEN_STYLE, BODY_HIDING_ENABLED, SELECTORS_POLLING_TIMEOUT, VISITOR_API_TIMEOUT, OVERRIDE_MBOX_EDGE_SERVER, OVERRIDE_MBOX_EDGE_SERVER_TIMEOUT, OPTOUT_ENABLED, OPTIN_ENABLED, SECURE_ONLY, SUPPLEMENTAL_DATA_ID_PARAM_TIMEOUT, AUTHORING_SCRIPT_URL, URL_SIZE_LIMIT, ENDPOINT, PAGE_LOAD_ENABLED, VIEWS_ENABLED, ANALYTICS_LOGGING, SERVER_STATE, DECISIONING_METHOD_SETTING, POLLING_INTERVAL_SETTING, ARTIFACT_LOCATION_SETTING, ARTIFACT_FORMAT_SETTING, ARTIFACT_PAYLOAD_SETTING, TARGET_ENVIRONMENT_SETTING, CDN_ENVIRONMENT_SETTING, TELEMETRY_ENABLED_SETTING, CDN_BASEPATH_SETTING, CSP_SCRIPT_NONCE, CSP_STYLE_NONCE, GLOBAL_MBOX_NAME]; + function overrideSettingsIfRequired(settings, globalSettings) { + if (!settings[ENABLED]) { + return; + } + if (!isNil(globalSettings[GLOBAL_MBOX_AUTO_CREATE])) { + settings[PAGE_LOAD_ENABLED] = globalSettings[GLOBAL_MBOX_AUTO_CREATE]; + } + forEach(field => { + if (!isNil(globalSettings[field])) { + settings[field] = globalSettings[field]; + } + }, OVERRIDABLE_SETTINGS); + } + function isIE10OrModernBrowser(doc) { + const { + documentMode + } = doc; + return documentMode ? documentMode >= 10 : true; + } + function isStandardMode(doc) { + const { + compatMode + } = doc; + return compatMode && compatMode === "CSS1Compat"; + } + function isIPv4(domain) { + return IP_V4_REGEX.test(domain); + } + function getCookieDomain(domain) { + if (isIPv4(domain)) { + return domain; + } + const parts = reverse(split(".", domain)); + const len = parts.length; + if (len >= 3) { + if (STANDARD_DOMAIN_REGEX.test(parts[1])) { + return parts[2] + "." + parts[1] + "." + parts[0]; + } + } + if (len === 1) { + return parts[0]; + } + return parts[1] + "." + parts[0]; + } + function overrideFromGlobalSettings(win, doc, settings) { + const fileProtocol = win.location.protocol === FILE_PROTOCOL; + let cookieDomain = ""; + if (!fileProtocol) { + cookieDomain = getCookieDomain(win.location.hostname); + } + settings[COOKIE_DOMAIN] = cookieDomain; + settings[ENABLED] = isStandardMode(doc) && isIE10OrModernBrowser(doc); + overrideSettingsIfRequired(settings, win[GLOBAL_SETTINGS] || {}); + } + function initConfig(settings) { + overrideFromGlobalSettings(window$1, document$1, settings); + const fileProtocol = window$1.location.protocol === FILE_PROTOCOL; + config = reactorObjectAssign({}, settings); + config[DEVICE_ID_LIFETIME] = settings[DEVICE_ID_LIFETIME] / 1000; + config[SESSION_ID_LIFETIME] = settings[SESSION_ID_LIFETIME] / 1000; + config[SCHEME] = config[SECURE_ONLY] || fileProtocol ? "https:" : ""; + } + function getConfig() { + return config; + } + + var js_cookie = {exports: {}}; + + /*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ + (function (module, exports) { + (function (factory) { + var registeredInModuleLoader; + { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } + })(function () { + function extend() { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[i]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + function decode(s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + function init(converter) { + function api() {} + function set(key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + attributes = extend({ + path: '/' + }, api.defaults, attributes); + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + return document.cookie = key + '=' + value + stringifiedAttributes; + } + function get(key, json) { + if (typeof document === 'undefined') { + return; + } + var jar = {}; + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || decode(cookie); + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + jar[name] = cookie; + if (key === name) { + break; + } + } catch (e) {} + } + return key ? jar[key] : jar; + } + api.set = set; + api.get = function (key) { + return get(key, false + ); + }; + api.getJSON = function (key) { + return get(key, true + ); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + api.defaults = {}; + api.withConverter = init; + return api; + } + return init(function () {}); + }); + })(js_cookie); + + var cookie = js_cookie.exports; + var reactorCookie = { + get: cookie.get, + set: cookie.set, + remove: cookie.remove + }; + + var querystring$1 = {}; + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + var decode$1 = function (qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + var regexp = /\+/g; + qs = qs.split(sep); + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + var len = qs.length; + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, + vstr, + k, + v; + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + return obj; + }; + + var stringifyPrimitive = function (v) { + switch (typeof v) { + case 'string': + return v; + case 'boolean': + return v ? 'true' : 'false'; + case 'number': + return isFinite(v) ? v : ''; + default: + return ''; + } + }; + var encode$1 = function (obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + if (typeof obj === 'object') { + return Object.keys(obj).map(function (k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (Array.isArray(obj[k])) { + return obj[k].map(function (v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + } + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); + }; + + querystring$1.decode = querystring$1.parse = decode$1; + querystring$1.encode = querystring$1.stringify = encode$1; + + var querystring = querystring$1; + var reactorQueryString = { + parse: function (string) { + if (typeof string === 'string') { + string = string.trim().replace(/^[?#&]/, ''); + } + return querystring.parse(string); + }, + stringify: function (object) { + return querystring.stringify(object); + } + }; + + const { + parse, + stringify + } = reactorQueryString; + const ANCHOR = document$1.createElement("a"); + const CACHE$1 = {}; + function parseQueryString(value) { + try { + return parse(value); + } catch (e) { + return {}; + } + } + function stringifyQueryString(value) { + try { + return stringify(value); + } catch (e) { + return ""; + } + } + function decode(value) { + try { + return decodeURIComponent(value); + } catch (e) { + return value; + } + } + function encode(value) { + try { + return encodeURIComponent(value); + } catch (e) { + return value; + } + } + function parseUri(url) { + if (CACHE$1[url]) { + return CACHE$1[url]; + } + ANCHOR.href = url; + const parsedUri = parseUri$1(ANCHOR.href); + parsedUri.queryKey = parseQueryString(parsedUri.query); + CACHE$1[url] = parsedUri; + return CACHE$1[url]; + } + + const { + get: getCookie, + set: setCookie, + remove: removeCookie + } = reactorCookie; + const MBOX_COOKIE = "mbox"; + function createCookie(name, value, expires) { + return { + name, + value, + expires + }; + } + function deserialize(str) { + const parts = split("#", str); + if (isEmpty(parts) || parts.length < 3) { + return null; + } + if (isNaN(parseInt(parts[2], 10))) { + return null; + } + return createCookie(decode(parts[0]), decode(parts[1]), Number(parts[2])); + } + function getInternalCookies(cookieValue) { + if (isBlank(cookieValue)) { + return []; + } + return split("|", cookieValue); + } + function readCookies() { + const cookies = map(deserialize, getInternalCookies(getCookie(MBOX_COOKIE))); + const nowInSeconds = Math.ceil(now() / 1000); + const isExpired = val => isObject(val) && nowInSeconds <= val.expires; + return reduce((acc, val) => { + acc[val.name] = val; + return acc; + }, {}, filter(isExpired, cookies)); + } + + function getTargetCookie(name) { + const cookiesMap = readCookies(); + const cookie = cookiesMap[name]; + return isObject(cookie) ? cookie.value : ""; + } + function serialize(cookie) { + return join("#", [encode(cookie.name), encode(cookie.value), cookie.expires]); + } + function getExpires(cookie) { + return cookie.expires; + } + function getMaxExpires(cookies) { + const expires = map(getExpires, cookies); + return Math.max.apply(null, expires); + } + function saveCookies(cookiesMap, domain, secure) { + const cookies = toArray(cookiesMap); + const maxExpires = Math.abs(getMaxExpires(cookies) * 1000 - now()); + const serializedCookies = join("|", map(serialize, cookies)); + const expires = new Date(now() + maxExpires); + const attrs = reactorObjectAssign({ + domain, + expires, + secure + }, secure ? { + sameSite: SAMESITE_NONE + } : {}); + setCookie(MBOX_COOKIE, serializedCookies, attrs); + } + function setTargetCookie(options) { + const { + name, + value, + expires, + domain, + secure + } = options; + const cookiesMap = readCookies(); + cookiesMap[name] = createCookie(name, value, Math.ceil(expires + now() / 1000)); + saveCookies(cookiesMap, domain, secure); + } + + function isCookiePresent(name) { + return isNotBlank(getCookie(name)); + } + function isParamPresent(win, name) { + const { + location + } = win; + const { + search + } = location; + const params = parseQueryString(search); + return isNotBlank(params[name]); + } + function isRefParamPresent(doc, name) { + const { + referrer + } = doc; + const parsedUri = parseUri(referrer); + const refParams = parsedUri.queryKey; + return isNil(refParams) ? false : isNotBlank(refParams[name]); + } + function exists$2(win, doc, name) { + return isCookiePresent(name) || isParamPresent(win, name) || isRefParamPresent(doc, name); + } + + function isCookieEnabled() { + const config = getConfig(); + const cookieDomain = config[COOKIE_DOMAIN]; + const secure = config[SECURE_ONLY]; + const attrs = reactorObjectAssign({ + domain: cookieDomain, + secure + }, secure ? { + sameSite: SAMESITE_NONE + } : {}); + setCookie(CHECK, TRUE, attrs); + const result = getCookie(CHECK) === TRUE; + removeCookie(CHECK); + return result; + } + function isDeliveryDisabled() { + return exists$2(window$1, document$1, DISABLE); + } + function isDeliveryEnabled() { + const config = getConfig(); + const enabled = config[ENABLED]; + return enabled && isCookieEnabled() && !isDeliveryDisabled(); + } + function isDebugEnabled() { + return exists$2(window$1, document$1, DEBUG); + } + function isAuthoringEnabled() { + return exists$2(window$1, document$1, AUTHORING); + } + + const ADOBE_TARGET_PREFIX = "AT:"; + function exists$1(win, method) { + const { + console + } = win; + return !isNil(console) && isFunction(console[method]); + } + function warn(win, args) { + const { + console + } = win; + if (!exists$1(win, "warn")) { + return; + } + console.warn.apply(console, [ADOBE_TARGET_PREFIX].concat(args)); + } + function debug(win, args) { + const { + console + } = win; + if (!exists$1(win, "debug")) { + return; + } + if (isDebugEnabled()) { + console.debug.apply(console, [ADOBE_TARGET_PREFIX].concat(args)); + } + } + + function logWarn() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + warn(window$1, args); + } + function logDebug() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + debug(window$1, args); + } + + const TRACES_FORMAT_VERSION = "1"; + function getSettings(config) { + return reduce((acc, key) => { + acc[key] = config[key]; + return acc; + }, {}, OVERRIDABLE_SETTINGS); + } + function initialize(win, config, debugEnabled) { + const result = win[TRACES] || []; + win[TRACES] = result; + if (!debugEnabled) { + return; + } + const oldPush = result.push; + result[VERSION] = TRACES_FORMAT_VERSION; + result[SETTINGS] = getSettings(config); + result[CLIENT_TRACES] = []; + result[SERVER_TRACES] = []; + result.push = function push(trace) { + result[SERVER_TRACES].push(reactorObjectAssign({ + timestamp: now() + }, trace)); + oldPush.call(this, trace); + }; + } + function saveTrace(win, namespace, trace, debugEnabled) { + if (namespace === SERVER_TRACES) { + win[TRACES].push(trace); + } + if (!debugEnabled) { + return; + } + if (namespace !== SERVER_TRACES) { + win[TRACES][namespace].push(reactorObjectAssign({ + timestamp: now() + }, trace)); + } + } + + function initTraces() { + initialize(window$1, getConfig(), isDebugEnabled()); + } + function addServerTrace(trace) { + saveTrace(window$1, SERVER_TRACES, trace, isDebugEnabled()); + } + function addClientTrace(trace) { + saveTrace(window$1, CLIENT_TRACES, trace, isDebugEnabled()); + } + + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then(function (value) { + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + return constructor.resolve(callback()).then(function () { + return constructor.reject(reason); + }); + }); + } + + var setTimeoutFunc = setTimeout; + function isArray(x) { + return Boolean(x && typeof x.length !== 'undefined'); + } + function noop() {} + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise$2(fn) { + if (!(this instanceof Promise$2)) throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise$2._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve$1 : reject$1)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject$1(deferred.promise, e); + return; + } + resolve$1(deferred.promise, ret); + }); + } + function resolve$1(self, newValue) { + try { + if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise$2) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject$1(self, e); + } + } + function reject$1(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise$2._immediateFn(function () { + if (!self._handled) { + Promise$2._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) return; + done = true; + resolve$1(self, value); + }, function (reason) { + if (done) return; + done = true; + reject$1(self, reason); + }); + } catch (ex) { + if (done) return; + done = true; + reject$1(self, ex); + } + } + Promise$2.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise$2.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise$2.prototype['finally'] = finallyConstructor; + Promise$2.all = function (arr) { + return new Promise$2(function (resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.all accepts an array')); + } + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise$2.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise$2) { + return value; + } + return new Promise$2(function (resolve) { + resolve(value); + }); + }; + Promise$2.reject = function (value) { + return new Promise$2(function (resolve, reject) { + reject(value); + }); + }; + Promise$2.race = function (arr) { + return new Promise$2(function (resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.race accepts an array')); + } + for (var i = 0, len = arr.length; i < len; i++) { + Promise$2.resolve(arr[i]).then(resolve, reject); + } + }); + }; + Promise$2._immediateFn = + typeof setImmediate === 'function' && function (fn) { + setImmediate(fn); + } || function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise$2._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + + var src = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': Promise$2 + }); + + var require$$0 = /*@__PURE__*/getAugmentedNamespace(src); + + var reactorPromise = typeof window !== 'undefined' && window.Promise || typeof commonjsGlobal$1 !== 'undefined' && commonjsGlobal$1.Promise || require$$0.default || require$$0; + + var $ = (function (window) { + var Zepto = function () { + var undefined$1, + key, + $, + classList, + emptyArray = [], + concat = emptyArray.concat, + filter = emptyArray.filter, + slice = emptyArray.slice, + document = window.document, + elementDisplay = {}, + classCache = {}, + cssNumber = { + "column-count": 1, + columns: 1, + "font-weight": 1, + "line-height": 1, + opacity: 1, + "z-index": 1, + zoom: 1 + }, + fragmentRE = /^\s*<(\w+|!)[^>]*>/, + singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, + tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rootNodeRE = /^(?:body|html)$/i, + capitalRE = /([A-Z])/g, + methodAttributes = ["val", "css", "html", "text", "data", "width", "height", "offset"], + adjacencyOperators = ["after", "prepend", "before", "append"], + table = document.createElement("table"), + tableRow = document.createElement("tr"), + containers = { + tr: document.createElement("tbody"), + tbody: table, + thead: table, + tfoot: table, + td: tableRow, + th: tableRow, + "*": document.createElement("div") + }, + readyRE = /complete|loaded|interactive/, + simpleSelectorRE = /^[\w-]*$/, + class2type = {}, + toString = class2type.toString, + zepto = {}, + camelize, + uniq, + tempParent = document.createElement("div"), + propMap = { + tabindex: "tabIndex", + readonly: "readOnly", + 'for': "htmlFor", + 'class': "className", + maxlength: "maxLength", + cellspacing: "cellSpacing", + cellpadding: "cellPadding", + rowspan: "rowSpan", + colspan: "colSpan", + usemap: "useMap", + frameborder: "frameBorder", + contenteditable: "contentEditable" + }, + isArray = Array.isArray || function (object) { + return object instanceof Array; + }; + zepto.matches = function (element, selector) { + if (!selector || !element || element.nodeType !== 1) return false; + var matchesSelector = element.matches || element.webkitMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.matchesSelector; + if (matchesSelector) return matchesSelector.call(element, selector); + var match, + parent = element.parentNode, + temp = !parent; + if (temp) (parent = tempParent).appendChild(element); + match = ~zepto.qsa(parent, selector).indexOf(element); + temp && tempParent.removeChild(element); + return match; + }; + function type(obj) { + return obj == null ? String(obj) : class2type[toString.call(obj)] || "object"; + } + function isFunction(value) { + return type(value) == "function"; + } + function isWindow(obj) { + return obj != null && obj == obj.window; + } + function isDocument(obj) { + return obj != null && obj.nodeType == obj.DOCUMENT_NODE; + } + function isObject(obj) { + return type(obj) == "object"; + } + function isPlainObject(obj) { + return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype; + } + function likeArray(obj) { + var length = !!obj && "length" in obj && obj.length, + type = $.type(obj); + return "function" != type && !isWindow(obj) && ("array" == type || length === 0 || typeof length == "number" && length > 0 && length - 1 in obj); + } + function compact(array) { + return filter.call(array, function (item) { + return item != null; + }); + } + function flatten(array) { + return array.length > 0 ? $.fn.concat.apply([], array) : array; + } + camelize = function (str) { + return str.replace(/-+(.)?/g, function (match, chr) { + return chr ? chr.toUpperCase() : ""; + }); + }; + function dasherize(str) { + return str.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase(); + } + uniq = function (array) { + return filter.call(array, function (item, idx) { + return array.indexOf(item) == idx; + }); + }; + function classRE(name) { + return name in classCache ? classCache[name] : classCache[name] = new RegExp("(^|\\s)" + name + "(\\s|$)"); + } + function maybeAddPx(name, value) { + return typeof value == "number" && !cssNumber[dasherize(name)] ? value + "px" : value; + } + function defaultDisplay(nodeName) { + var element, display; + if (!elementDisplay[nodeName]) { + element = document.createElement(nodeName); + document.body.appendChild(element); + display = getComputedStyle(element, "").getPropertyValue("display"); + element.parentNode.removeChild(element); + display == "none" && (display = "block"); + elementDisplay[nodeName] = display; + } + return elementDisplay[nodeName]; + } + function children(element) { + return "children" in element ? slice.call(element.children) : $.map(element.childNodes, function (node) { + if (node.nodeType == 1) return node; + }); + } + function Z(dom, selector) { + var i, + len = dom ? dom.length : 0; + for (i = 0; i < len; i++) this[i] = dom[i]; + this.length = len; + this.selector = selector || ""; + } + zepto.fragment = function (html, name, properties) { + var dom, nodes, container; + if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1)); + if (!dom) { + if (html.replace) html = html.replace(tagExpanderRE, "<$1>"); + if (name === undefined$1) name = fragmentRE.test(html) && RegExp.$1; + if (!(name in containers)) name = "*"; + container = containers[name]; + container.innerHTML = "" + html; + dom = $.each(slice.call(container.childNodes), function () { + container.removeChild(this); + }); + } + if (isPlainObject(properties)) { + nodes = $(dom); + $.each(properties, function (key, value) { + if (methodAttributes.indexOf(key) > -1) nodes[key](value);else nodes.attr(key, value); + }); + } + return dom; + }; + zepto.Z = function (dom, selector) { + return new Z(dom, selector); + }; + zepto.isZ = function (object) { + return object instanceof zepto.Z; + }; + zepto.init = function (selector, context) { + var dom; + if (!selector) return zepto.Z();else if (typeof selector == "string") { + selector = selector.trim(); + if (selector[0] == "<" && fragmentRE.test(selector)) dom = zepto.fragment(selector, RegExp.$1, context), selector = null;else if (context !== undefined$1) + return $(context).find(selector); + else dom = zepto.qsa(document, selector); + } else if (isFunction(selector)) + return $(document).ready(selector);else if (zepto.isZ(selector)) + return selector;else { + if (isArray(selector)) dom = compact(selector);else if (isObject(selector)) + dom = [selector], selector = null;else if (fragmentRE.test(selector)) + dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null;else if (context !== undefined$1) + return $(context).find(selector); + else dom = zepto.qsa(document, selector); + } + return zepto.Z(dom, selector); + }; + $ = function (selector, context) { + return zepto.init(selector, context); + }; + function extend(target, source, deep) { + for (key in source) if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) target[key] = {}; + if (isArray(source[key]) && !isArray(target[key])) target[key] = []; + extend(target[key], source[key], deep); + } else if (source[key] !== undefined$1) target[key] = source[key]; + } + $.extend = function (target) { + var deep, + args = slice.call(arguments, 1); + if (typeof target == "boolean") { + deep = target; + target = args.shift(); + } + args.forEach(function (arg) { + extend(target, arg, deep); + }); + return target; + }; + zepto.qsa = function (element, selector) { + var found, + maybeID = selector[0] == "#", + maybeClass = !maybeID && selector[0] == ".", + nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, + isSimple = simpleSelectorRE.test(nameOnly); + return element.getElementById && isSimple && maybeID + ? (found = element.getElementById(nameOnly)) ? [found] : [] : element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11 ? [] : slice.call(isSimple && !maybeID && element.getElementsByClassName + ? maybeClass ? element.getElementsByClassName(nameOnly) + : element.getElementsByTagName(selector) + : element.querySelectorAll(selector) + ); + }; + function filtered(nodes, selector) { + return selector == null ? $(nodes) : $(nodes).filter(selector); + } + $.contains = document.documentElement.contains ? function (parent, node) { + return parent !== node && parent.contains(node); + } : function (parent, node) { + while (node && (node = node.parentNode)) if (node === parent) return true; + return false; + }; + function funcArg(context, arg, idx, payload) { + return isFunction(arg) ? arg.call(context, idx, payload) : arg; + } + function setAttribute(node, name, value) { + value == null ? node.removeAttribute(name) : node.setAttribute(name, value); + } + function className(node, value) { + var klass = node.className || "", + svg = klass && klass.baseVal !== undefined$1; + if (value === undefined$1) return svg ? klass.baseVal : klass; + svg ? klass.baseVal = value : node.className = value; + } + function deserializeValue(value) { + try { + return value ? value == "true" || (value == "false" ? false : value == "null" ? null : +value + "" == value ? +value : /^[\[\{]/.test(value) ? $.parseJSON(value) : value) : value; + } catch (e) { + return value; + } + } + $.type = type; + $.isFunction = isFunction; + $.isWindow = isWindow; + $.isArray = isArray; + $.isPlainObject = isPlainObject; + $.isEmptyObject = function (obj) { + var name; + for (name in obj) return false; + return true; + }; + $.isNumeric = function (val) { + var num = Number(val), + type = typeof val; + return val != null && type != "boolean" && (type != "string" || val.length) && !isNaN(num) && isFinite(num) || false; + }; + $.inArray = function (elem, array, i) { + return emptyArray.indexOf.call(array, elem, i); + }; + $.camelCase = camelize; + $.trim = function (str) { + return str == null ? "" : String.prototype.trim.call(str); + }; + $.uuid = 0; + $.support = {}; + $.expr = {}; + $.noop = function () {}; + $.map = function (elements, callback) { + var value, + values = [], + i, + key; + if (likeArray(elements)) for (i = 0; i < elements.length; i++) { + value = callback(elements[i], i); + if (value != null) values.push(value); + } else for (key in elements) { + value = callback(elements[key], key); + if (value != null) values.push(value); + } + return flatten(values); + }; + $.each = function (elements, callback) { + var i, key; + if (likeArray(elements)) { + for (i = 0; i < elements.length; i++) if (callback.call(elements[i], i, elements[i]) === false) return elements; + } else { + for (key in elements) if (callback.call(elements[key], key, elements[key]) === false) return elements; + } + return elements; + }; + $.grep = function (elements, callback) { + return filter.call(elements, callback); + }; + if (window.JSON) $.parseJSON = JSON.parse; + $.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (i, name) { + class2type["[object " + name + "]"] = name.toLowerCase(); + }); + $.fn = { + constructor: zepto.Z, + length: 0, + forEach: emptyArray.forEach, + reduce: emptyArray.reduce, + push: emptyArray.push, + sort: emptyArray.sort, + splice: emptyArray.splice, + indexOf: emptyArray.indexOf, + concat: function () { + var i, + value, + args = []; + for (i = 0; i < arguments.length; i++) { + value = arguments[i]; + args[i] = zepto.isZ(value) ? value.toArray() : value; + } + return concat.apply(zepto.isZ(this) ? this.toArray() : this, args); + }, + map: function (fn) { + return $($.map(this, function (el, i) { + return fn.call(el, i, el); + })); + }, + slice: function () { + return $(slice.apply(this, arguments)); + }, + ready: function (callback) { + if (readyRE.test(document.readyState) && document.body) callback($);else document.addEventListener("DOMContentLoaded", function () { + callback($); + }, false); + return this; + }, + get: function (idx) { + return idx === undefined$1 ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]; + }, + toArray: function () { + return this.get(); + }, + size: function () { + return this.length; + }, + remove: function () { + return this.each(function () { + if (this.parentNode != null) this.parentNode.removeChild(this); + }); + }, + each: function (callback) { + var len = this.length, + idx = 0, + el; + while (idx < len) { + el = this[idx]; + if (callback.call(el, idx, el) === false) { + break; + } + idx++; + } + return this; + }, + filter: function (selector) { + if (isFunction(selector)) return this.not(this.not(selector)); + return $(filter.call(this, function (element) { + return zepto.matches(element, selector); + })); + }, + add: function (selector, context) { + return $(uniq(this.concat($(selector, context)))); + }, + is: function (selector) { + return this.length > 0 && zepto.matches(this[0], selector); + }, + not: function (selector) { + var nodes = []; + if (isFunction(selector) && selector.call !== undefined$1) this.each(function (idx) { + if (!selector.call(this, idx)) nodes.push(this); + });else { + var excludes = typeof selector == "string" ? this.filter(selector) : likeArray(selector) && isFunction(selector.item) ? slice.call(selector) : $(selector); + this.forEach(function (el) { + if (excludes.indexOf(el) < 0) nodes.push(el); + }); + } + return $(nodes); + }, + has: function (selector) { + return this.filter(function () { + return isObject(selector) ? $.contains(this, selector) : $(this).find(selector).size(); + }); + }, + eq: function (idx) { + return idx === -1 ? this.slice(idx) : this.slice(idx, +idx + 1); + }, + first: function () { + var el = this[0]; + return el && !isObject(el) ? el : $(el); + }, + last: function () { + var el = this[this.length - 1]; + return el && !isObject(el) ? el : $(el); + }, + find: function (selector) { + var result, + $this = this; + if (!selector) result = $();else if (typeof selector == "object") result = $(selector).filter(function () { + var node = this; + return emptyArray.some.call($this, function (parent) { + return $.contains(parent, node); + }); + });else if (this.length == 1) result = $(zepto.qsa(this[0], selector));else result = this.map(function () { + return zepto.qsa(this, selector); + }); + return result; + }, + closest: function (selector, context) { + var nodes = [], + collection = typeof selector == "object" && $(selector); + this.each(function (_, node) { + while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector))) node = node !== context && !isDocument(node) && node.parentNode; + if (node && nodes.indexOf(node) < 0) nodes.push(node); + }); + return $(nodes); + }, + parents: function (selector) { + var ancestors = [], + nodes = this; + while (nodes.length > 0) nodes = $.map(nodes, function (node) { + if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) { + ancestors.push(node); + return node; + } + }); + return filtered(ancestors, selector); + }, + parent: function (selector) { + return filtered(uniq(this.pluck("parentNode")), selector); + }, + children: function (selector) { + return filtered(this.map(function () { + return children(this); + }), selector); + }, + contents: function () { + return this.map(function () { + return this.contentDocument || slice.call(this.childNodes); + }); + }, + siblings: function (selector) { + return filtered(this.map(function (i, el) { + return filter.call(children(el.parentNode), function (child) { + return child !== el; + }); + }), selector); + }, + empty: function () { + return this.each(function () { + this.innerHTML = ""; + }); + }, + pluck: function (property) { + return $.map(this, function (el) { + return el[property]; + }); + }, + show: function () { + return this.each(function () { + this.style.display == "none" && (this.style.display = ""); + if (getComputedStyle(this, "").getPropertyValue("display") == "none") this.style.display = defaultDisplay(this.nodeName); + }); + }, + replaceWith: function (newContent) { + return this.before(newContent).remove(); + }, + wrap: function (structure) { + var func = isFunction(structure); + if (this[0] && !func) var dom = $(structure).get(0), + clone = dom.parentNode || this.length > 1; + return this.each(function (index) { + $(this).wrapAll(func ? structure.call(this, index) : clone ? dom.cloneNode(true) : dom); + }); + }, + wrapAll: function (structure) { + if (this[0]) { + $(this[0]).before(structure = $(structure)); + var children; + while ((children = structure.children()).length) structure = children.first(); + $(structure).append(this); + } + return this; + }, + wrapInner: function (structure) { + var func = isFunction(structure); + return this.each(function (index) { + var self = $(this), + contents = self.contents(), + dom = func ? structure.call(this, index) : structure; + contents.length ? contents.wrapAll(dom) : self.append(dom); + }); + }, + unwrap: function () { + this.parent().each(function () { + $(this).replaceWith($(this).children()); + }); + return this; + }, + clone: function () { + return this.map(function () { + return this.cloneNode(true); + }); + }, + hide: function () { + return this.css("display", "none"); + }, + toggle: function (setting) { + return this.each(function () { + var el = $(this); + (setting === undefined$1 ? el.css("display") == "none" : setting) ? el.show() : el.hide(); + }); + }, + prev: function (selector) { + return $(this.pluck("previousElementSibling")).filter(selector || "*"); + }, + next: function (selector) { + return $(this.pluck("nextElementSibling")).filter(selector || "*"); + }, + html: function (html) { + return 0 in arguments ? this.each(function (idx) { + var originHtml = this.innerHTML; + $(this).empty().append(funcArg(this, html, idx, originHtml)); + }) : 0 in this ? this[0].innerHTML : null; + }, + text: function (text) { + return 0 in arguments ? this.each(function (idx) { + var newText = funcArg(this, text, idx, this.textContent); + this.textContent = newText == null ? "" : "" + newText; + }) : 0 in this ? this.pluck("textContent").join("") : null; + }, + attr: function (name, value) { + var result; + return typeof name == "string" && !(1 in arguments) ? 0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined$1 : this.each(function (idx) { + if (this.nodeType !== 1) return; + if (isObject(name)) for (key in name) setAttribute(this, key, name[key]);else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name))); + }); + }, + removeAttr: function (name) { + return this.each(function () { + this.nodeType === 1 && name.split(" ").forEach(function (attribute) { + setAttribute(this, attribute); + }, this); + }); + }, + prop: function (name, value) { + name = propMap[name] || name; + return 1 in arguments ? this.each(function (idx) { + this[name] = funcArg(this, value, idx, this[name]); + }) : this[0] && this[0][name]; + }, + removeProp: function (name) { + name = propMap[name] || name; + return this.each(function () { + delete this[name]; + }); + }, + data: function (name, value) { + var attrName = "data-" + name.replace(capitalRE, "-$1").toLowerCase(); + var data = 1 in arguments ? this.attr(attrName, value) : this.attr(attrName); + return data !== null ? deserializeValue(data) : undefined$1; + }, + val: function (value) { + if (0 in arguments) { + if (value == null) value = ""; + return this.each(function (idx) { + this.value = funcArg(this, value, idx, this.value); + }); + } else { + return this[0] && (this[0].multiple ? $(this[0]).find("option").filter(function () { + return this.selected; + }).pluck("value") : this[0].value); + } + }, + offset: function (coordinates) { + if (coordinates) return this.each(function (index) { + var $this = $(this), + coords = funcArg(this, coordinates, index, $this.offset()), + parentOffset = $this.offsetParent().offset(), + props = { + top: coords.top - parentOffset.top, + left: coords.left - parentOffset.left + }; + if ($this.css("position") == "static") props["position"] = "relative"; + $this.css(props); + }); + if (!this.length) return null; + if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0])) return { + top: 0, + left: 0 + }; + var obj = this[0].getBoundingClientRect(); + return { + left: obj.left + window.pageXOffset, + top: obj.top + window.pageYOffset, + width: Math.round(obj.width), + height: Math.round(obj.height) + }; + }, + css: function (property, value) { + if (arguments.length < 2) { + var element = this[0]; + if (typeof property == "string") { + if (!element) return; + return element.style[camelize(property)] || getComputedStyle(element, "").getPropertyValue(property); + } else if (isArray(property)) { + if (!element) return; + var props = {}; + var computedStyle = getComputedStyle(element, ""); + $.each(property, function (_, prop) { + props[prop] = element.style[camelize(prop)] || computedStyle.getPropertyValue(prop); + }); + return props; + } + } + var css = ""; + if (type(property) == "string") { + if (!value && value !== 0) this.each(function () { + this.style.removeProperty(dasherize(property)); + });else css = dasherize(property) + ":" + maybeAddPx(property, value); + } else { + for (key in property) if (!property[key] && property[key] !== 0) this.each(function () { + this.style.removeProperty(dasherize(key)); + });else css += dasherize(key) + ":" + maybeAddPx(key, property[key]) + ";"; + } + return this.each(function () { + this.style.cssText += ";" + css; + }); + }, + index: function (element) { + return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0]); + }, + hasClass: function (name) { + if (!name) return false; + return emptyArray.some.call(this, function (el) { + return this.test(className(el)); + }, classRE(name)); + }, + addClass: function (name) { + if (!name) return this; + return this.each(function (idx) { + if (!("className" in this)) return; + classList = []; + var cls = className(this), + newName = funcArg(this, name, idx, cls); + newName.split(/\s+/g).forEach(function (klass) { + if (!$(this).hasClass(klass)) classList.push(klass); + }, this); + classList.length && className(this, cls + (cls ? " " : "") + classList.join(" ")); + }); + }, + removeClass: function (name) { + return this.each(function (idx) { + if (!("className" in this)) return; + if (name === undefined$1) return className(this, ""); + classList = className(this); + funcArg(this, name, idx, classList).split(/\s+/g).forEach(function (klass) { + classList = classList.replace(classRE(klass), " "); + }); + className(this, classList.trim()); + }); + }, + toggleClass: function (name, when) { + if (!name) return this; + return this.each(function (idx) { + var $this = $(this), + names = funcArg(this, name, idx, className(this)); + names.split(/\s+/g).forEach(function (klass) { + (when === undefined$1 ? !$this.hasClass(klass) : when) ? $this.addClass(klass) : $this.removeClass(klass); + }); + }); + }, + scrollTop: function (value) { + if (!this.length) return; + var hasScrollTop = ("scrollTop" in this[0]); + if (value === undefined$1) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset; + return this.each(hasScrollTop ? function () { + this.scrollTop = value; + } : function () { + this.scrollTo(this.scrollX, value); + }); + }, + scrollLeft: function (value) { + if (!this.length) return; + var hasScrollLeft = ("scrollLeft" in this[0]); + if (value === undefined$1) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset; + return this.each(hasScrollLeft ? function () { + this.scrollLeft = value; + } : function () { + this.scrollTo(value, this.scrollY); + }); + }, + position: function () { + if (!this.length) return; + var elem = this[0], + offsetParent = this.offsetParent(), + offset = this.offset(), + parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { + top: 0, + left: 0 + } : offsetParent.offset(); + offset.top -= parseFloat($(elem).css("margin-top")) || 0; + offset.left -= parseFloat($(elem).css("margin-left")) || 0; + parentOffset.top += parseFloat($(offsetParent[0]).css("border-top-width")) || 0; + parentOffset.left += parseFloat($(offsetParent[0]).css("border-left-width")) || 0; + return { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + }, + offsetParent: function () { + return this.map(function () { + var parent = this.offsetParent || document.body; + while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static") parent = parent.offsetParent; + return parent; + }); + } + }; + $.fn.detach = $.fn.remove; + ["width", "height"].forEach(function (dimension) { + var dimensionProperty = dimension.replace(/./, function (m) { + return m[0].toUpperCase(); + }); + $.fn[dimension] = function (value) { + var offset, + el = this[0]; + if (value === undefined$1) return isWindow(el) ? el["inner" + dimensionProperty] : isDocument(el) ? el.documentElement["scroll" + dimensionProperty] : (offset = this.offset()) && offset[dimension];else return this.each(function (idx) { + el = $(this); + el.css(dimension, funcArg(this, value, idx, el[dimension]())); + }); + }; + }); + function traverseNode(node, fun) { + fun(node); + for (var i = 0, len = node.childNodes.length; i < len; i++) traverseNode(node.childNodes[i], fun); + } + function executeScript(doc, content, nonce) { + const nearestNode = doc.getElementsByTagName("script")[0]; + if (!nearestNode) { + return; + } + const parentNode = nearestNode.parentNode; + if (!parentNode) { + return; + } + const script = doc.createElement("script"); + script.innerHTML = content; + if (isNotBlank(nonce)) { + script.setAttribute("nonce", nonce); + } + parentNode.appendChild(script); + parentNode.removeChild(script); + } + adjacencyOperators.forEach(function (operator, operatorIndex) { + var inside = operatorIndex % 2; + $.fn[operator] = function () { + var argType, + nodes = $.map(arguments, function (arg) { + var arr = []; + argType = type(arg); + if (argType == "array") { + arg.forEach(function (el) { + if (el.nodeType !== undefined$1) return arr.push(el);else if ($.zepto.isZ(el)) return arr = arr.concat(el.get()); + arr = arr.concat(zepto.fragment(el)); + }); + return arr; + } + return argType == "object" || arg == null ? arg : zepto.fragment(arg); + }), + parent, + copyByClone = this.length > 1; + if (nodes.length < 1) return this; + return this.each(function (_, target) { + parent = inside ? target : target.parentNode; + target = operatorIndex == 0 ? target.nextSibling : operatorIndex == 1 ? target.firstChild : operatorIndex == 2 ? target : null; + const parentInDocument = $.contains(document.documentElement, parent); + const SCRIPT_TYPES = /^(text|application)\/(javascript|ecmascript)$/; + const config = getConfig(); + const scriptNonce = config[CSP_SCRIPT_NONCE]; + const styleNonce = config[CSP_STYLE_NONCE]; + nodes.forEach(function (node) { + if (copyByClone) node = node.cloneNode(true);else if (!parent) return $(node).remove(); + if (isNotBlank(scriptNonce) && node.tagName === "SCRIPT") { + node.setAttribute("nonce", scriptNonce); + } + if (isNotBlank(styleNonce) && node.tagName === "STYLE") { + node.setAttribute("nonce", styleNonce); + } + parent.insertBefore(node, target); + if (parentInDocument) traverseNode(node, function (el) { + if (el.nodeName != null && el.nodeName.toUpperCase() === "SCRIPT" && (!el.type || SCRIPT_TYPES.test(el.type.toLowerCase())) && !el.src) { + executeScript(document, el.innerHTML, el.nonce); + } + }); + }); + }); + }; + $.fn[inside ? operator + "To" : "insert" + (operatorIndex ? "Before" : "After")] = function (html) { + $(html)[operator](this); + return this; + }; + }); + zepto.Z.prototype = Z.prototype = $.fn; + zepto.uniq = uniq; + zepto.deserializeValue = deserializeValue; + $.zepto = zepto; + return $; + }(); + (function ($) { + var _zid = 1, + undefined$1, + slice = Array.prototype.slice, + isFunction = $.isFunction, + isString = function (obj) { + return typeof obj == "string"; + }, + handlers = {}, + specialEvents = {}, + focusinSupported = ("onfocusin" in window), + focus = { + focus: "focusin", + blur: "focusout" + }, + hover = { + mouseenter: "mouseover", + mouseleave: "mouseout" + }; + specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = "MouseEvents"; + function zid(element) { + return element._zid || (element._zid = _zid++); + } + function findHandlers(element, event, fn, selector) { + event = parse(event); + if (event.ns) var matcher = matcherFor(event.ns); + return (handlers[zid(element)] || []).filter(function (handler) { + return handler && (!event.e || handler.e == event.e) && (!event.ns || matcher.test(handler.ns)) && (!fn || zid(handler.fn) === zid(fn)) && (!selector || handler.sel == selector); + }); + } + function parse(event) { + var parts = ("" + event).split("."); + return { + e: parts[0], + ns: parts.slice(1).sort().join(" ") + }; + } + function matcherFor(ns) { + return new RegExp("(?:^| )" + ns.replace(" ", " .* ?") + "(?: |$)"); + } + function eventCapture(handler, captureSetting) { + return handler.del && !focusinSupported && handler.e in focus || !!captureSetting; + } + function realEvent(type) { + return hover[type] || focusinSupported && focus[type] || type; + } + function add(element, events, fn, data, selector, delegator, capture) { + var id = zid(element), + set = handlers[id] || (handlers[id] = []); + events.split(/\s/).forEach(function (event) { + if (event == "ready") return $(document).ready(fn); + var handler = parse(event); + handler.fn = fn; + handler.sel = selector; + if (handler.e in hover) fn = function (e) { + var related = e.relatedTarget; + if (!related || related !== this && !$.contains(this, related)) return handler.fn.apply(this, arguments); + }; + handler.del = delegator; + var callback = delegator || fn; + handler.proxy = function (e) { + e = compatible(e); + if (e.isImmediatePropagationStopped()) return; + e.data = data; + var result = callback.apply(element, e._args == undefined$1 ? [e] : [e].concat(e._args)); + if (result === false) e.preventDefault(), e.stopPropagation(); + return result; + }; + handler.i = set.length; + set.push(handler); + if ("addEventListener" in element) element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)); + }); + } + function remove(element, events, fn, selector, capture) { + var id = zid(element); + (events || "").split(/\s/).forEach(function (event) { + findHandlers(element, event, fn, selector).forEach(function (handler) { + delete handlers[id][handler.i]; + if ("removeEventListener" in element) element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture)); + }); + }); + } + $.event = { + add: add, + remove: remove + }; + $.proxy = function (fn, context) { + var args = 2 in arguments && slice.call(arguments, 2); + if (isFunction(fn)) { + var proxyFn = function () { + return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments); + }; + proxyFn._zid = zid(fn); + return proxyFn; + } else if (isString(context)) { + if (args) { + args.unshift(fn[context], fn); + return $.proxy.apply(null, args); + } else { + return $.proxy(fn[context], fn); + } + } else { + throw new TypeError("expected function"); + } + }; + $.fn.bind = function (event, data, callback) { + return this.on(event, data, callback); + }; + $.fn.unbind = function (event, callback) { + return this.off(event, callback); + }; + $.fn.one = function (event, selector, data, callback) { + return this.on(event, selector, data, callback, 1); + }; + var returnTrue = function () { + return true; + }, + returnFalse = function () { + return false; + }, + ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/, + eventMethods = { + preventDefault: "isDefaultPrevented", + stopImmediatePropagation: "isImmediatePropagationStopped", + stopPropagation: "isPropagationStopped" + }; + function compatible(event, source) { + if (source || !event.isDefaultPrevented) { + source || (source = event); + $.each(eventMethods, function (name, predicate) { + var sourceMethod = source[name]; + event[name] = function () { + this[predicate] = returnTrue; + return sourceMethod && sourceMethod.apply(source, arguments); + }; + event[predicate] = returnFalse; + }); + try { + event.timeStamp || (event.timeStamp = new Date().getTime()); + } catch (ignored) {} + if (source.defaultPrevented !== undefined$1 ? source.defaultPrevented : "returnValue" in source ? source.returnValue === false : source.getPreventDefault && source.getPreventDefault()) event.isDefaultPrevented = returnTrue; + } + return event; + } + function createProxy(event) { + var key, + proxy = { + originalEvent: event + }; + for (key in event) if (!ignoreProperties.test(key) && event[key] !== undefined$1) proxy[key] = event[key]; + return compatible(proxy, event); + } + $.fn.delegate = function (selector, event, callback) { + return this.on(event, selector, callback); + }; + $.fn.undelegate = function (selector, event, callback) { + return this.off(event, selector, callback); + }; + $.fn.live = function (event, callback) { + $(document.body).delegate(this.selector, event, callback); + return this; + }; + $.fn.die = function (event, callback) { + $(document.body).undelegate(this.selector, event, callback); + return this; + }; + $.fn.on = function (event, selector, data, callback, one) { + var autoRemove, + delegator, + $this = this; + if (event && !isString(event)) { + $.each(event, function (type, fn) { + $this.on(type, selector, data, fn, one); + }); + return $this; + } + if (!isString(selector) && !isFunction(callback) && callback !== false) callback = data, data = selector, selector = undefined$1; + if (callback === undefined$1 || data === false) callback = data, data = undefined$1; + if (callback === false) callback = returnFalse; + return $this.each(function (_, element) { + if (one) autoRemove = function (e) { + remove(element, e.type, callback); + return callback.apply(this, arguments); + }; + if (selector) delegator = function (e) { + var evt, + match = $(e.target).closest(selector, element).get(0); + if (match && match !== element) { + evt = $.extend(createProxy(e), { + currentTarget: match, + liveFired: element + }); + return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1))); + } + }; + add(element, event, callback, data, selector, delegator || autoRemove); + }); + }; + $.fn.off = function (event, selector, callback) { + var $this = this; + if (event && !isString(event)) { + $.each(event, function (type, fn) { + $this.off(type, selector, fn); + }); + return $this; + } + if (!isString(selector) && !isFunction(callback) && callback !== false) callback = selector, selector = undefined$1; + if (callback === false) callback = returnFalse; + return $this.each(function () { + remove(this, event, callback, selector); + }); + }; + $.fn.trigger = function (event, args) { + event = isString(event) || $.isPlainObject(event) ? $.Event(event) : compatible(event); + event._args = args; + return this.each(function () { + if (event.type in focus && typeof this[event.type] == "function") this[event.type]();else if ("dispatchEvent" in this) + this.dispatchEvent(event);else $(this).triggerHandler(event, args); + }); + }; + $.fn.triggerHandler = function (event, args) { + var e, result; + this.each(function (i, element) { + e = createProxy(isString(event) ? $.Event(event) : event); + e._args = args; + e.target = element; + $.each(findHandlers(element, event.type || event), function (i, handler) { + result = handler.proxy(e); + if (e.isImmediatePropagationStopped()) return false; + }); + }); + return result; + }; + ("focusin focusout focus blur load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select keydown keypress keyup error").split(" ").forEach(function (event) { + $.fn[event] = function (callback) { + return 0 in arguments ? this.bind(event, callback) : this.trigger(event); + }; + }); + $.Event = function (type, props) { + if (!isString(type)) props = type, type = props.type; + var event = document.createEvent(specialEvents[type] || "Events"), + bubbles = true; + if (props) for (var name in props) name == "bubbles" ? bubbles = !!props[name] : event[name] = props[name]; + event.initEvent(type, bubbles, true); + return compatible(event); + }; + })(Zepto); + (function () { + try { + getComputedStyle(undefined); + } catch (e) { + var nativeGetComputedStyle = getComputedStyle; + window.getComputedStyle = function (element, pseudoElement) { + try { + return nativeGetComputedStyle(element, pseudoElement); + } catch (e) { + return null; + } + }; + } + })(); + (function ($) { + var zepto = $.zepto, + oldQsa = zepto.qsa, + childRe = /^\s*>/, + shadowDomSeparator = ":shadow", + classTag = "Zepto" + +new Date(); + var qsa = function (node, selector) { + var sel = selector, + nodes, + taggedParent; + try { + if (!sel) sel = "*";else if (childRe.test(sel)) + taggedParent = $(node).addClass(classTag), sel = "." + classTag + " " + sel; + nodes = oldQsa(node, sel); + } catch (e) { + throw e; + } finally { + if (taggedParent) taggedParent.removeClass(classTag); + } + return nodes; + }; + zepto.qsa = function (node, selector) { + var parts = selector.split(shadowDomSeparator); + if (parts.length < 2) { + return qsa(node, selector); + } + var parent = node; + for (var i = 0; i < parts.length; i++) { + var part = parts[i].trim(); + var subselIdx = part.indexOf(">"); + if (subselIdx === 0) { + var prefix = ":host "; + if (parent instanceof Element || parent instanceof HTMLDocument) { + prefix = ":scope "; + } + part = prefix + part; + } + var partNode = qsa(parent, part); + if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) { + return partNode; + } + parent = partNode[0].shadowRoot; + } + }; + })(Zepto); + return Zepto; + })(window); + + const MO_OBJECT = window$1.MutationObserver || window$1.WebkitMutationObserver; + function canUseMutationObserver() { + return isFunction(MO_OBJECT); + } + function getMutationObserver(callback) { + return new MO_OBJECT(callback); + } + + const ARRAY_EXPECTED = "Expected an array of promises"; + function getMoImmediateFn() { + const textnode = document$1.createTextNode(""); + const twiddleNode = () => { + textnode.textContent = textnode.textContent.length > 0 ? "" : "a"; + }; + const callbacks = []; + const mo = getMutationObserver(() => { + const len = callbacks.length; + for (let i = 0; i < len; i += 1) { + callbacks[i](); + } + callbacks.splice(0, len); + }); + mo.observe(textnode, { + characterData: true + }); + return fn => { + callbacks.push(fn); + twiddleNode(); + }; + } + function getOnReadyStateChangeImmediateFn() { + return fn => { + let scriptEl = $(" - - +
- - diff --git a/react-shopping-cart-demo/package-lock.json b/react-shopping-cart-demo/package-lock.json index bf90ed6..cc85568 100644 --- a/react-shopping-cart-demo/package-lock.json +++ b/react-shopping-cart-demo/package-lock.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@adobe/target-nodejs-sdk": "^2.1.0", + "@adobe/target-tools": "^1.6.2", "axios": "^0.19.0", "cookie-parser": "^1.4.4", "express": "^4.16.4", @@ -55,6 +56,14 @@ "resolved": "https://registry.npmjs.org/@adobe-mcid/visitor-js-shared/-/visitor-js-shared-0.0.7.tgz", "integrity": "sha1-SDrwi+GrSwv2s0hYpI1Uc9sIfVQ=" }, + "node_modules/@adobe/reactor-object-assign": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@adobe/reactor-object-assign/-/reactor-object-assign-1.0.0.tgz", + "integrity": "sha512-WI3uplIKeFqqGYyU0IRbXwq+7Nk40EF40s7UmDNL5hdVkiDhEtXmWmbuGPjapKQfe3BoxMlH+pk/rxTva/DaUw==", + "dependencies": { + "object-assign": "4.1.1" + } + }, "node_modules/@adobe/target-nodejs-sdk": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@adobe/target-nodejs-sdk/-/target-nodejs-sdk-2.2.1.tgz", @@ -71,6 +80,16 @@ "node": ">=8.16.0" } }, + "node_modules/@adobe/target-tools": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@adobe/target-tools/-/target-tools-1.6.2.tgz", + "integrity": "sha512-okZtGuMLjNI9p5Z8ruXYAdo7GqfWwZkBRJgAd16SaY97AtD2nbHToTeqvSAG4+5Ov0ohm6W5B6/52d1tRZnI2Q==", + "dependencies": { + "@adobe/reactor-object-assign": "^1.0.0", + "parse-uri": "^1.0.0", + "performance-now": "^2.1.0" + } + }, "node_modules/@babel/runtime": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.3.tgz", @@ -5740,6 +5759,14 @@ "node": ">=0.10.0" } }, + "node_modules/parse-uri": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/parse-uri/-/parse-uri-1.0.7.tgz", + "integrity": "sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg==", + "engines": { + "node": ">= 0.10" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -5829,6 +5856,11 @@ "node": ">=0.12" } }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "node_modules/pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -9609,6 +9641,14 @@ "resolved": "https://registry.npmjs.org/@adobe-mcid/visitor-js-shared/-/visitor-js-shared-0.0.7.tgz", "integrity": "sha1-SDrwi+GrSwv2s0hYpI1Uc9sIfVQ=" }, + "@adobe/reactor-object-assign": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@adobe/reactor-object-assign/-/reactor-object-assign-1.0.0.tgz", + "integrity": "sha512-WI3uplIKeFqqGYyU0IRbXwq+7Nk40EF40s7UmDNL5hdVkiDhEtXmWmbuGPjapKQfe3BoxMlH+pk/rxTva/DaUw==", + "requires": { + "object-assign": "4.1.1" + } + }, "@adobe/target-nodejs-sdk": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@adobe/target-nodejs-sdk/-/target-nodejs-sdk-2.2.1.tgz", @@ -9622,6 +9662,16 @@ "whatwg-fetch": "^3.0.0" } }, + "@adobe/target-tools": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@adobe/target-tools/-/target-tools-1.6.2.tgz", + "integrity": "sha512-okZtGuMLjNI9p5Z8ruXYAdo7GqfWwZkBRJgAd16SaY97AtD2nbHToTeqvSAG4+5Ov0ohm6W5B6/52d1tRZnI2Q==", + "requires": { + "@adobe/reactor-object-assign": "^1.0.0", + "parse-uri": "^1.0.0", + "performance-now": "^2.1.0" + } + }, "@babel/runtime": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.6.3.tgz", @@ -14450,6 +14500,11 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, + "parse-uri": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/parse-uri/-/parse-uri-1.0.7.tgz", + "integrity": "sha512-eWuZCMKNlVkXrEoANdXxbmqhu2SQO9jUMCSpdbJDObin0JxISn6e400EWsSRbr/czdKvWKkhZnMKEGUwf/Plmg==" + }, "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -14518,6 +14573,11 @@ "sha.js": "^2.4.8" } }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", diff --git a/react-shopping-cart-demo/package.json b/react-shopping-cart-demo/package.json index 327d455..9135cb1 100644 --- a/react-shopping-cart-demo/package.json +++ b/react-shopping-cart-demo/package.json @@ -16,6 +16,7 @@ "license": "Apache-2.0", "dependencies": { "@adobe/target-nodejs-sdk": "^2.1.0", + "@adobe/target-tools": "^1.6.2", "axios": "^0.19.0", "cookie-parser": "^1.4.4", "express": "^4.16.4", diff --git a/react-shopping-cart-demo/public/alloy.js b/react-shopping-cart-demo/public/alloy.js new file mode 100644 index 0000000..4ddc7b7 --- /dev/null +++ b/react-shopping-cart-demo/public/alloy.js @@ -0,0 +1,9942 @@ +/** + * Copyright 2019 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +(function () { + 'use strict'; + + if (document.documentMode && document.documentMode < 11) { + console.warn('The Adobe Experience Cloud Web SDK does not support IE 10 and below.'); + return; + } + + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createInstanceFunction = (function (executeCommand) { + return function (args) { + // Would use destructuring, but destructuring doesn't work on IE + // without polyfilling Symbol. + // https://github.com/babel/babel/issues/7597 + var resolve = args[0]; + var reject = args[1]; + var userProvidedArgs = args[2]; + var commandName = userProvidedArgs[0]; + var options = userProvidedArgs[1]; + executeCommand(commandName, options).then(resolve, reject); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var CHROME = "Chrome"; + var EDGE$1 = "Edge"; + var EDGE_CHROMIUM = "EdgeChromium"; + var FIREFOX = "Firefox"; + var IE = "IE"; + var SAFARI = "Safari"; + var UNKNOWN = "Unknown"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Determines whether an array includes a certain value. + * @param {Array} arr Array to search. + * @param {*} item The item for which to search. + * @returns {boolean} + */ + var includes = (function (arr, item) { + return arr.indexOf(item) !== -1; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // we don't know. We also assume "unknown" browsers support third-party cookies, + // though we don't really know that either. We're making best guesses. + + var browsersSupportingThirdPartyCookie = [CHROME, EDGE$1, EDGE_CHROMIUM, IE, UNKNOWN]; + var areThirdPartyCookiesSupportedByDefault = (function (browser) { + return includes(browsersSupportingThirdPartyCookie, browser); + }); + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + /* eslint-disable no-unused-vars */ + + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } // Detect buggy property enumeration order in older V8 versions. + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + + + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + + test1[5] = 'de'; + + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + + + var test2 = {}; + + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + + if (order2.join('') !== '0123456789') { + return false; + } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + + + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + + if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty$1.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + var reactorObjectAssign = objectAssign; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var MILLISECOND = 1; + var SECOND = MILLISECOND * 1000; + var MINUTE = SECOND * 60; + var HOUR = MINUTE * 60; + var DAY = HOUR * 24; + var convertTimes = (function (fromUnit, toUnit, amount) { + return fromUnit * amount / toUnit; + }); + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var js_cookie = createCommonjsModule(function (module, exports) { + + (function (factory) { + var registeredInModuleLoader; + + { + module.exports = factory(); + registeredInModuleLoader = true; + } + + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } + })(function () { + function extend() { + var i = 0; + var result = {}; + + for (; i < arguments.length; i++) { + var attributes = arguments[i]; + + for (var key in attributes) { + result[key] = attributes[key]; + } + } + + return result; + } + + function decode(s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init(converter) { + function api() {} + + function set(key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } // We're using "expires" because "max-age" is not supported by IE + + + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape); + var stringifiedAttributes = ''; + + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + + stringifiedAttributes += '; ' + attributeName; + + if (attributes[attributeName] === true) { + continue; + } // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + + + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return document.cookie = key + '=' + value + stringifiedAttributes; + } + + function get(key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + + api.get = function (key) { + return get(key, false + /* read as raw */ + ); + }; + + api.getJSON = function (key) { + return get(key, true + /* read as json */ + ); + }; + + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + api.withConverter = init; + return api; + } + + return init(function () {}); + }); + }); + + // we have a little more flexibility to change the underlying implementation later. If clear + // use cases come up for needing the other methods js-cookie exposes, we can re-evaluate whether + // we want to expose them here. + + + var reactorCookie = { + get: js_cookie.get, + set: js_cookie.set, + remove: js_cookie.remove + }; + reactorCookie.get; + reactorCookie.set; + reactorCookie.remove; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns true whether the value is null or undefined. + * @param {*} value + * @returns {boolean} + */ + var isNil = (function (value) { + return value == null; + }); + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread2(target) { + for (var i = 1; i < arguments.length; i++) { + var source = null != arguments[i] ? arguments[i] : {}; + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + + return target; + } + + function _typeof(obj) { + "@babel/helpers - typeof"; + + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }, _typeof(obj); + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _objectWithoutPropertiesLoose(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; + } + + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); + } + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + function _iterableToArrayLimit(arr, i) { + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; + + if (_i == null) return; + var _arr = []; + var _n = true; + var _d = false; + + var _s, _e; + + try { + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + /** + * Returns whether the value is an object. + * @param {*} value + * @returns {boolean} + */ + + var isObject = (function (value) { + return !isNil(value) && !Array.isArray(value) && _typeof(value) === "object"; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var deepAssignObject = function deepAssignObject(target, source) { + Object.keys(source).forEach(function (key) { + if (isObject(target[key]) && isObject(source[key])) { + deepAssignObject(target[key], source[key]); + return; + } + + target[key] = source[key]; + }); + }; + /** + * Recursively copy the values of all enumerable own properties from a source item to a target item if the both items are objects + * @param {Object} target - a target object + * @param {...Object} source - an array of source objects + * @example + * deepAssign({ a: 'a', b: 'b' }, { b: 'B', c: 'c' }); + * // { a: 'a', b: 'B', c: 'c' } + */ + + + var deepAssign = (function (target) { + if (isNil(target)) { + throw new TypeError('deepAssign "target" cannot be null or undefined'); + } + + var result = Object(target); + + for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + sources[_key - 1] = arguments[_key]; + } + + sources.forEach(function (source) { + return deepAssignObject(result, Object(source)); + }); + return result; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Creates a function that, when passed an object of updates, will merge + * the updates onto the current value of a payload property. + * @param {Object} content The base object to modify + * @param {String } key The property to merge updates into. This + * can be a dot-notation property path. + * @returns {Function} + */ + + var createMerger = (function (content, key) { + return function (updates) { + var propertyPath = key.split("."); + var hostObjectForUpdates = propertyPath.reduce(function (obj, propertyName) { + obj[propertyName] = obj[propertyName] || {}; + return obj[propertyName]; + }, content); + deepAssign(hostObjectForUpdates, updates); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Allows callbacks to be registered and then later called. When the + * callbacks are called, their responses are combined into a single promise. + */ + var createCallbackAggregator = (function () { + var callbacks = []; + return { + add: function add(callback) { + callbacks.push(callback); + }, + call: function call() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + // While this utility doesn't necessarily need to be doing the + // Promise.all, it's currently useful everywhere this is used and + // reduces repetitive code. We can factor it out later if we want + // to make this utility more "pure". + return Promise.all(callbacks.map(function (callback) { + return callback.apply(void 0, args); + })); + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Sequences tasks. + */ + var createTaskQueue = (function () { + var queueLength = 0; + var lastPromiseInQueue = Promise.resolve(); + return { + /** + * Add a task to the queue. If no task is currenty running, + * the task will begin immediately. + * @param {Function} task A function that will be called when + * the task should be run. If the task it asynchronous, it should + * return a promise. + * @returns {Promise} A promise that will be resolved or rejected + * with whatever value the task resolved or rejects its promise. + */ + addTask: function addTask(task) { + queueLength += 1; + + var lastPromiseFulfilledHandler = function lastPromiseFulfilledHandler() { + return task().finally(function () { + queueLength -= 1; + }); + }; + + lastPromiseInQueue = lastPromiseInQueue.then(lastPromiseFulfilledHandler, lastPromiseFulfilledHandler); + return lastPromiseInQueue; + }, + + /** + * How many tasks are in the queue. This includes the task + * that's currently running. + * @returns {number} + */ + get length() { + return queueLength; + } + + }; + }); + + /* eslint-disable */ + + /* + crc32 · JavaScript Function to Calculate CRC32 of a String + Description + Below is a JavaScript function to calculate CRC32 of a string. + The string can be either ASCII or Unicode. + Unicode strings will be encoded in UTF-8. + The polynomial used in calculation is 0xedb88320. + This polynomial is used in Ethernet, Gzip, PNG, SATA and many other technologies. + */ + var crc32 = function () { + var table = []; + + for (var i = 0; i < 256; i++) { + var c = i; + + for (var j = 0; j < 8; j++) { + c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1; + } + + table.push(c); + } + + return function (str, crc) { + str = unescape(encodeURIComponent(str)); + if (!crc) crc = 0; + crc = crc ^ -1; + + for (var _i = 0; _i < str.length; _i++) { + var y = (crc ^ str.charCodeAt(_i)) & 0xff; + crc = crc >>> 8 ^ table[y]; + } + + crc = crc ^ -1; + return crc >>> 0; + }; + }(); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * A simple utility for managing a promise's state outside of + * the promise's "executor" (the function passed into the constructor). + */ + var defer = (function () { + var deferred = {}; + deferred.promise = new Promise(function (resolve, reject) { + deferred.resolve = resolve; + deferred.reject = reject; + }); + return deferred; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Whether a string ends with the characters of a specified string + * @param {String} str The string to search within. + * @param {String} suffix The string to search for. + * @returns {boolean} + */ + var endsWith = (function (str, suffix) { + return str.substr(-suffix.length) === suffix; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns the first item in the array that satisfies the provided testing function. + * @param {Array} arr The array to search. + * @param {Function} predicate Function that will be called for each item. Arguments + * will be the item, the item index, then the array itself. + * @returns {*} + */ + var find = (function (arr, predicate) { + for (var i = 0; i < arr.length; i += 1) { + var item = arr[i]; + + if (predicate(item, i, arr)) { + return item; + } + } + + return undefined; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var appendNode = (function (parent, node) { + return parent.appendChild(node); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var populateElementProperties = function populateElementProperties(element, props) { + Object.keys(props).forEach(function (key) { + // The following is to support setting style properties to avoid CSP errors. + if (key === "style" && isObject(props[key])) { + var styleProps = props[key]; + Object.keys(styleProps).forEach(function (styleKey) { + element.style[styleKey] = styleProps[styleKey]; + }); + } else { + element[key] = props[key]; + } + }); + }; + + var createNode = (function (tag) { + var attrs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + var doc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document; + var result = doc.createElement(tag); + Object.keys(attrs).forEach(function (key) { + // TODO: To highlight CSP problems consider throwing a descriptive error + // if nonce is available and key is style. + result.setAttribute(key, attrs[key]); + }); + populateElementProperties(result, props); + children.forEach(function (child) { + return appendNode(result, child); + }); + return result; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var BODY = "BODY"; + var IFRAME = "IFRAME"; + var IMG = "IMG"; + var DIV = "DIV"; + var STYLE = "STYLE"; + var SCRIPT = "SCRIPT"; + var HEAD = "HEAD"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Fires an image pixel from the current document's window. + * @param {object} currentDocument + * @param {string} src + * @returns {Promise} + */ + + var fireImageInDocument = (function (_ref) { + var src = _ref.src, + _ref$currentDocument = _ref.currentDocument, + currentDocument = _ref$currentDocument === void 0 ? document : _ref$currentDocument; + return new Promise(function (resolve, reject) { + var attrs = { + src: src + }; + var props = { + onload: resolve, + onerror: reject, + onabort: reject + }; + createNode(IMG, attrs, props, [], currentDocument); + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns whether the value is a function. + * @param {*} value + * @returns {boolean} + */ + var isFunction = (function (value) { + return typeof value === "function"; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns whether the value is a non-empty array. + * @param {*} value + * @returns {boolean} + */ + var isNonEmptyArray = (function (value) { + return Array.isArray(value) && value.length > 0; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var toArray = (function (value) { + if (Array.isArray(value)) { + return value; + } + + if (value == null) { + return []; + } + + return [].slice.call(value); + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var querySelectorAll = (function (context, selector) { + return toArray(context.querySelectorAll(selector)); + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Whether a string starts with the characters of a specified string + * @param {String} str The string to search within. + * @param {String} prefix The string to search for. + * @returns {boolean} + */ + var startsWith = (function (str, prefix) { + return str.substr(0, prefix.length) === prefix; + }); + + /* + Copyright 2022 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var SHADOW_SEPARATOR = ":shadow"; + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var splitWithShadow = function splitWithShadow(selector) { + return selector.split(SHADOW_SEPARATOR); + }; + + var transformPrefix = function transformPrefix(parent, selector) { + var result = selector.trim(); + var hasChildCombinatorPrefix = startsWith(result, ">"); + + if (!hasChildCombinatorPrefix) { + return result; + } // IE doesn't support :scope + + + if (window.document.documentMode) { + return result.substring(1).trim(); + } + + var prefix = parent instanceof Element || parent instanceof HTMLDocument ? ":scope" : ":host"; // see https://bugs.webkit.org/show_bug.cgi?id=233380 + + return prefix + " " + result; + }; + + var selectNodesWithShadow = (function (context, selector) { + // Shadow DOM should be supported + if (!window.document.documentElement.attachShadow) { + return querySelectorAll(context, selector.replace(SHADOW_SEPARATOR, "")); + } + + var parts = splitWithShadow(selector); + + if (parts.length < 2) { + return querySelectorAll(context, selector); + } // split the selector into parts separated by :shadow pseudo-selectors + // find each subselector element based on the previously selected node's shadowRoot + + + var parent = context; + + for (var i = 0; i < parts.length; i += 1) { + var part = transformPrefix(parent, parts[i]); + var partNode = querySelectorAll(parent, part); + + if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) { + return partNode; + } + + parent = partNode[0].shadowRoot; + } + + return undefined; + }); + + /* + Copyright 2022 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var isShadowSelector = (function (str) { + return str.indexOf(SHADOW_SEPARATOR) !== -1; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns an array of matched DOM nodes. + * @param {String} selector + * @param {Node} [context=document] defaults to document + * @returns {Array} an array of DOM nodes + */ + + var selectNodes = (function (selector) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; + + if (!isShadowSelector(selector)) { + return querySelectorAll(context, selector); + } + + return selectNodesWithShadow(context, selector); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var MUTATION_OBSERVER = "MutationObserver"; + var RAF = "requestAnimationFrame"; + var MUTATION_OBSERVER_CONFIG = { + childList: true, + subtree: true + }; + var VISIBILITY_STATE = "visibilityState"; + var VISIBLE = "visible"; + var DELAY = 100; + var MAX_POLLING_TIMEOUT = 5000; + + var createError = function createError(selector) { + return new Error("Could not find: " + selector); + }; + + var createPromise = function createPromise(executor) { + return new Promise(executor); + }; + + var canUseMutationObserver = function canUseMutationObserver(win) { + return isFunction(win[MUTATION_OBSERVER]); + }; + var awaitUsingMutationObserver = function awaitUsingMutationObserver(win, doc, selector, timeout, selectFunc) { + return createPromise(function (resolve, reject) { + var mutationObserver = new win[MUTATION_OBSERVER](function () { + var nodes = selectFunc(selector); + + if (isNonEmptyArray(nodes)) { + mutationObserver.disconnect(); + resolve(nodes); + } + }); + setTimeout(function () { + mutationObserver.disconnect(); + reject(createError(selector)); + }, timeout); + mutationObserver.observe(doc, MUTATION_OBSERVER_CONFIG); + }); + }; + var canUseRequestAnimationFrame = function canUseRequestAnimationFrame(doc) { + return doc[VISIBILITY_STATE] === VISIBLE; + }; + var awaitUsingRequestAnimation = function awaitUsingRequestAnimation(win, selector, timeout, selectFunc) { + return createPromise(function (resolve, reject) { + var execute = function execute() { + var nodes = selectFunc(selector); + + if (isNonEmptyArray(nodes)) { + resolve(nodes); + return; + } + + win[RAF](execute); + }; + + execute(); + setTimeout(function () { + reject(createError(selector)); + }, timeout); + }); + }; + var awaitUsingTimer = function awaitUsingTimer(selector, timeout, selectFunc) { + return createPromise(function (resolve, reject) { + var execute = function execute() { + var nodes = selectFunc(selector); + + if (isNonEmptyArray(nodes)) { + resolve(nodes); + return; + } + + setTimeout(execute, DELAY); + }; + + execute(); + setTimeout(function () { + reject(createError(selector)); + }, timeout); + }); + }; + var awaitSelector = (function (selector) { + var selectFunc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : selectNodes; + var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MAX_POLLING_TIMEOUT; + var win = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : window; + var doc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document; + var nodes = selectFunc(selector); + + if (isNonEmptyArray(nodes)) { + return Promise.resolve(nodes); + } + + if (canUseMutationObserver(win)) { + return awaitUsingMutationObserver(win, doc, selector, timeout, selectFunc); + } + + if (canUseRequestAnimationFrame(doc)) { + return awaitUsingRequestAnimation(win, selector, timeout, selectFunc); + } + + return awaitUsingTimer(selector, timeout, selectFunc); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns true if element matches the selector. + * @param {String} selector + * @param {Node} [element] + * @returns {Boolean} + */ + var matchesSelector = (function (selector, element) { + if (element.matches) { + return element.matches(selector); + } // Making IE 11 happy + + + return element.msMatchesSelector(selector); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var removeNode = (function (node) { + var parent = node.parentNode; + + if (parent) { + return parent.removeChild(node); + } + + return null; + }); + + var IFRAME_ATTRS = { + name: "Adobe Alloy" + }; + var IFRAME_PROPS = { + style: { + display: "none", + width: 0, + height: 0 + } + }; + var injectFireReferrerHideableImage = (function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$appendNode = _ref.appendNode, + appendNode$1 = _ref$appendNode === void 0 ? appendNode : _ref$appendNode, + _ref$awaitSelector = _ref.awaitSelector, + awaitSelector$1 = _ref$awaitSelector === void 0 ? awaitSelector : _ref$awaitSelector, + _ref$createNode = _ref.createNode, + createNode$1 = _ref$createNode === void 0 ? createNode : _ref$createNode, + _ref$fireImage = _ref.fireImage, + fireImage = _ref$fireImage === void 0 ? fireImageInDocument : _ref$fireImage; + + var fireOnPage = fireImage; + var hiddenIframe; + + var createIframe = function createIframe() { + return awaitSelector$1(BODY).then(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 1), + body = _ref3[0]; + + if (hiddenIframe) { + return hiddenIframe; + } + + hiddenIframe = createNode$1(IFRAME, IFRAME_ATTRS, IFRAME_PROPS); + return appendNode$1(body, hiddenIframe); + }); + }; + + var fireInIframe = function fireInIframe(_ref4) { + var src = _ref4.src; + return createIframe().then(function (iframe) { + var currentDocument = iframe.contentWindow.document; + return fireImage({ + src: src, + currentDocument: currentDocument + }); + }); + }; + + return function (request) { + var hideReferrer = request.hideReferrer, + url = request.url; + return hideReferrer ? fireInIframe({ + src: url + }) : fireOnPage({ + src: url + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var flatMap = (function (array, mapFunction) { + return Array.prototype.concat.apply([], array.map(mapFunction)); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var baseNamespace = "com.adobe.alloy."; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns the last N number of items from an array. + * @param {Array} arr + * @param {number} itemCount + * @returns {Array} + */ + var getLastArrayItems = (function (arr, itemCount) { + return arr.slice(-itemCount); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var cookieName = baseNamespace + "getTld"; + /** + * Of the current web page's hostname, this is the top-most domain that is + * not a "public suffix" as outlined in https://publicsuffix.org/. In other + * words, this is top-most domain that is able to accept cookies. + * @param {Object} window + * @param {Object} cookieJar + * @returns {string} + */ + + var getApexDomain = (function (window, cookieJar) { + var topLevelCookieDomain = ""; // If hostParts.length === 1, we may be on localhost. + + var hostParts = window.location.hostname.toLowerCase().split("."); + var i = 1; + + while (i < hostParts.length && !cookieJar.get(cookieName)) { + i += 1; + topLevelCookieDomain = getLastArrayItems(hostParts, i).join("."); + cookieJar.set(cookieName, cookieName, { + domain: topLevelCookieDomain + }); + } + + cookieJar.remove(cookieName, { + domain: topLevelCookieDomain + }); + return topLevelCookieDomain; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // Remember to also incorporate the org ID wherever cookies are read or written. + var COOKIE_NAME_PREFIX = "kndctr"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var sanitizeOrgIdForCookieName = (function (orgId) { + return orgId.replace("@", "_"); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getNamespacedCookieName = (function (orgId, key) { + return COOKIE_NAME_PREFIX + "_" + sanitizeOrgIdForCookieName(orgId) + "_" + key; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var IDENTITY = "identity"; + var CONSENT = "consent"; + var EDGE_PATH = "path"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectDoesIdentityCookieExist = (function (_ref) { + var orgId = _ref.orgId; + var identityCookieName = getNamespacedCookieName(orgId, IDENTITY); + /** + * Returns whether the identity cookie exists. + */ + + return function () { + return Boolean(reactorCookie.get(identityCookieName)); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var getStorageByType = function getStorageByType(context, storageType, namespace) { + // When storage is disabled on Safari, the mere act of referencing + // window.localStorage or window.sessionStorage throws an error. + // For this reason, we wrap in a try-catch. + return { + /** + * Reads a value from storage. + * @param {string} name The name of the item to be read. + * @returns {string} + */ + getItem: function getItem(name) { + try { + return context[storageType].getItem(namespace + name); + } catch (e) { + return null; + } + }, + + /** + * Saves a value to storage. + * @param {string} name The name of the item to be saved. + * @param {string} value The value of the item to be saved. + * @returns {boolean} Whether the item was successfully saved to storage. + */ + setItem: function setItem(name, value) { + try { + context[storageType].setItem(namespace + name, value); + return true; + } catch (e) { + return false; + } + }, + + /** + * Clear all values in storage that match the namespace. + */ + clear: function clear() { + try { + Object.keys(context[storageType]).forEach(function (key) { + if (startsWith(key, namespace)) { + context[storageType].removeItem(key); + } + }); + return true; + } catch (e) { + return false; + } + } + }; + }; + + var injectStorage = (function (context) { + return function (additionalNamespace) { + var finalNamespace = baseNamespace + additionalNamespace; + return { + session: getStorageByType(context, "sessionStorage", finalNamespace), + persistent: getStorageByType(context, "localStorage", finalNamespace) + }; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns items that are found within both arrays. + * @param {Array} a + * @param {Array} b + * @returns {Array} + */ + + var intersection = (function (a, b) { + return a.filter(function (x) { + return includes(b, x); + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns whether the value is a boolean. + * @param {*} value + * @returns {boolean} + */ + var isBoolean = (function (value) { + return typeof value === "boolean"; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns whether the value is an empty object. + * @param {*} value + * @returns {boolean} + */ + + var isEmptyObject = (function (value) { + return isObject(value) && Object.keys(value).length === 0; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns whether the value is a number. + * @param {*} value + * @returns {boolean} + */ + // eslint-disable-next-line no-restricted-globals + var isNumber = (function (value) { + return typeof value === "number" && !isNaN(value); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns whether the value is an integer. + * @param {*} value + * @returns {boolean} + */ + + var isInteger = (function (value) { + var parsed = parseInt(value, 10); + return isNumber(parsed) && value === parsed; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Determines whether a cookie name is namespaced according to the contract + * defined by the server. + * @param {String} orgId The org ID configured for the Alloy instance. + * @param {String} name The cookie name. + * @returns {boolean} + */ + + var isNamespacedCookieName = (function (orgId, name) { + return name.indexOf(COOKIE_NAME_PREFIX + "_" + sanitizeOrgIdForCookieName(orgId) + "_") === 0; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns whether the value is a string. + * @param {*} value + * @returns {boolean} + */ + var isString = (function (value) { + return typeof value === "string"; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns whether the value is a populated string. + * @param {*} value + * @returns {boolean} + */ + + var isNonEmptyString = (function (value) { + return isString(value) && value.length > 0; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Creates a function that memoizes the result of `fn`. If `keyResolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. + * + * @param {Function} fn The function to have its output memoized. + * @param {Function} [keyResolver] The function to resolve the cache key. + * @returns {Function} The new memoized function. + */ + var memoize = (function (fn, keyResolver) { + var map = new Map(); + return function () { + var key = keyResolver ? keyResolver.apply(void 0, arguments) : arguments.length <= 0 ? undefined : arguments[0]; + + if (map.has(key)) { + return map.get(key); + } + + var result = fn.apply(void 0, arguments); + map.set(key, result); + return result; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * A function that performs no operations. + */ + var noop$1 = (function () {}); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart + var padStart = (function (string, targetLength, padString) { + var originalString = String(string); + var repeatedPadString = String(padString); + + if (originalString.length >= targetLength || repeatedPadString.length === 0) { + return originalString; + } + + var lengthToAdd = targetLength - originalString.length; + + while (lengthToAdd > repeatedPadString.length) { + repeatedPadString += repeatedPadString; + } + + return repeatedPadString.slice(0, lengthToAdd) + originalString; + }); + + // Copyright Joyent, Inc. and other Node contributors. + // obj.hasOwnProperty(prop) will break. + // See: https://github.com/joyent/node/issues/1707 + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + var decode = function decode(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + var maxKeys = 1000; + + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; // maxKeys <= 0 means that we should not limit keys count + + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, + vstr, + k, + v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (Array.isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; + }; + + // Copyright Joyent, Inc. and other Node contributors. + + var stringifyPrimitive = function stringifyPrimitive(v) { + switch (_typeof(v)) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } + }; + + var encode = function encode(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + + if (obj === null) { + obj = undefined; + } + + if (_typeof(obj) === 'object') { + return Object.keys(obj).map(function (k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + + if (Array.isArray(obj[k])) { + return obj[k].map(function (v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj)); + }; + + var querystring = createCommonjsModule(function (module, exports) { + + exports.decode = exports.parse = decode; + exports.encode = exports.stringify = encode; + }); + querystring.decode; + querystring.parse; + querystring.encode; + querystring.stringify; + + // This allows us to more easily make changes to the underlying implementation later without + // having to worry about breaking extensions. If extensions demand additional functionality, we + // can make adjustments as needed. + + + var reactorQueryString = { + parse: function parse(string) { + // + if (typeof string === 'string') { + // Remove leading ?, #, & for some leniency so you can pass in location.search or + // location.hash directly. + string = string.trim().replace(/^[?#&]/, ''); + } + + return querystring.parse(string); + }, + stringify: function stringify(object) { + return querystring.stringify(object); + } + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Creates and returns a new error using the provided value as a message. + * If the provided value is already an Error, it will be returned unmodified. + * @param {*} value + * @returns {Error} + */ + var toError = (function (value) { + return value instanceof Error ? value : new Error(value); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var updateErrorMessage = (function (_ref) { + var error = _ref.error, + message = _ref.message; + + try { + error.message = message; + } catch (e) {// We'll set a new message when we can, but some errors, like DOMException, + // have a read-only message property, which limits our options. + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Augments an error's message with additional context as it bubbles up the call stack. + * @param {String} message The message to be added to the error. + * @param {*} error Optimally, this is an instance of Error. If it is not, + * this is used as the basis for the message of a newly created Error instance. + * @returns {*} + */ + + var stackError = (function (_ref) { + var error = _ref.error, + message = _ref.message; + var errorToStack = toError(error); + var newMessage = message + "\nCaused by: " + errorToStack.message; + updateErrorMessage({ + error: errorToStack, + message: newMessage + }); + return errorToStack; + }); + + var stringToBoolean = (function (str) { + return isString(str) && str.toLowerCase() === "true"; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Formats the date into an ISO date-time string in the local timezone + * @param {Date} date + * @returns {string} + */ + + var toISOStringLocal = (function (date) { + var YYYY = date.getFullYear(); + var MM = padStart(date.getMonth() + 1, 2, "0"); + var DD = padStart(date.getDate(), 2, "0"); + var hh = padStart(date.getHours(), 2, "0"); + var mm = padStart(date.getMinutes(), 2, "0"); + var ss = padStart(date.getSeconds(), 2, "0"); + var mmm = padStart(date.getMilliseconds(), 3, "0"); // The time-zone offset is the difference, in minutes, from local time to UTC. Note that this + // means that the offset is positive if the local timezone is behind UTC and negative if it is + // ahead. For example, for time zone UTC+10:00, -600 will be returned. + + var timezoneOffset = date.getTimezoneOffset(); + var ts = timezoneOffset > 0 ? "-" : "+"; + var th = padStart(Math.floor(Math.abs(timezoneOffset) / 60), 2, "0"); + var tm = padStart(Math.abs(timezoneOffset) % 60, 2, "0"); + return YYYY + "-" + MM + "-" + DD + "T" + hh + ":" + mm + ":" + ss + "." + mmm + ts + th + ":" + tm; + }); + + var rngBrowser = createCommonjsModule(function (module) { + // Unique ID creation requires a high quality random # generator. In the + // browser this is a little complicated due to unknown quality of Math.random() + // and inconsistent support for the `crypto` API. We do the best we can via + // feature-detection + // getRandomValues needs to be invoked in a context where "this" is a Crypto + // implementation. Also, find the complete implementation of crypto on IE11. + var getRandomValues = typeof crypto != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto); + + if (getRandomValues) { + // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto + var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef + + module.exports = function whatwgRNG() { + getRandomValues(rnds8); + return rnds8; + }; + } else { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var rnds = new Array(16); + + module.exports = function mathRNG() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return rnds; + }; + } + }); + + /** + * Convert array of 16 byte values to UUID string format of the form: + * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX + */ + var byteToHex = []; + + for (var i = 0; i < 256; ++i) { + byteToHex[i] = (i + 0x100).toString(16).substr(1); + } + + function bytesToUuid(buf, offset) { + var i = offset || 0; + var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4 + + return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join(''); + } + + var bytesToUuid_1 = bytesToUuid; + + function v4(options, buf, offset) { + var i = buf && offset || 0; + + if (typeof options == 'string') { + buf = options === 'binary' ? new Array(16) : null; + options = null; + } + + options = options || {}; + var rnds = options.random || (options.rng || rngBrowser)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + + rnds[6] = rnds[6] & 0x0f | 0x40; + rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided + + if (buf) { + for (var ii = 0; ii < 16; ++ii) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || bytesToUuid_1(rnds); + } + + var v4_1 = v4; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Chains two validators together. + * + * Validators are functions of two parameters (value and path) that return the computed value if + * the input is valid, or throw an exception if the input is invalid. In most cases the returned + * value is the same as the input value; however, reference createDefaultValidator.js + * to see an example where the computed value is different from the input. Additionally, if we ever + * wanted to coerce types (i.e. parse string values into integers) as part of the validation process + * we could use the computed value to accomplish that. + * + * The path parameter is used to generate informative error messages. It is created by the objectOf, and + * arrayOf validators so that any error message can describe which key within the object or array is + * invalid. + * + * The validators also have methods to chain additional validation logic. For example, when you call + * `string()` to start a validator chain, it returns a validator function but it also has methods + * like `required` and `nonEmpty`. In index.js you can see that these methods are actually calling `chain`. + * Specifically in this function, the leftValidator is called first and then the return value of that is + * sent to the rightValidator. For example, when calling `string().nonEmpty().required()` the following + * chain is built up: + * ``` + * * + * / \ + * * required + * / \ + * * nonEmpty + * / \ + * base string + * ``` + * Where every * is a call to chain where the two are combined. The individual validators are called from + * left to right in the above tree. The base validator is simply the identity function `value => value`, + * representing an optional value. + * + * After combining the validators, the new validator function is then augmented with the methods from the + * leftValidator and from the additionalMethods parameter. For example, when the string() function is called + * it chains to the base validator, but also adds additional methods like (`regexp`, `domain`, `nonEmpty`, + * and `unique`). When `nonEmpty` is called, which calls chain again, the additional methods are carried + * forward because they are already defined on the leftValidator. + * + * The base validator also contains the two methods `required` and `default`, so these can be used anywhere + * after any of the exposed validator functions are called. + */ + + var chain = (function (leftValidator, rightValidator) { + var additionalMethods = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + // combine the two validators, calling left first and then right. + // pass the return value from left into right. + var combinedValidator = function combinedValidator(value, path) { + return rightValidator(leftValidator(value, path), path); + }; // add the methods already defined on the left validator, and the additionalMethods + // to the new combined validator function. + + + reactorObjectAssign(combinedValidator, leftValidator, additionalMethods); + return combinedValidator; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * This augments `chain` with a null check done before running the rightValidator. + * See chain for more info. + * + * For most validators, we want the validation to be optional (i.e. allow null or + * undefined values). To accomplish this, the validator needs to have a check + * at the begining of the function, short circuiting the validation logic and + * returning value if value is null or undefined. `default` and `required` do not + * want this null check though. Indeed, `default` should return the default value + * if value is null, and `required` should throw an error if value is null. + * + * So to keep from having to have a null check in front of most validators, this + * function allows you to chain a rightValidator that needs to have a null check. + */ + + var nullSafeChain = (function (leftValidator, rightValidator, additionalMethods) { + var rightValidatorWithNullCheck = function rightValidatorWithNullCheck(value, path) { + return value == null ? value : rightValidator(value, path); + }; + + return chain(leftValidator, rightValidatorWithNullCheck, additionalMethods); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var assertValid = (function (isValid, value, path, message) { + if (!isValid) { + throw new Error("'" + path + "': Expected " + message + ", but got " + JSON.stringify(value) + "."); + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var booleanValidator = (function (value, path) { + assertValid(isBoolean(value), value, path, "true or false"); + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var callbackValidator = (function (value, path) { + assertValid(isFunction(value), value, path, "a function"); + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createArrayOfValidator = (function (elementValidator) { + return function (value, path) { + assertValid(Array.isArray(value), value, path, "an array"); + var errors = []; + var validatedArray = value.map(function (subValue, i) { + try { + return elementValidator(subValue, path + "[" + i + "]"); + } catch (e) { + errors.push(e.message); + return undefined; + } + }); + + if (errors.length) { + throw new Error(errors.join("\n")); + } + + return validatedArray; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createDefaultValidator = (function (defaultValue) { + return function (value) { + if (value == null) { + return defaultValue; + } + + return value; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createLiteralValidator = (function (literalValue) { + return function (value, path) { + assertValid(value === literalValue, value, path, "" + literalValue); + return value; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createMapOfValuesValidator = (function (valueValidator) { + return function (value, path) { + assertValid(isObject(value), value, path, "an object"); + var errors = []; + var validatedObject = {}; + Object.keys(value).forEach(function (subKey) { + var subValue = value[subKey]; + var subPath = path ? path + "." + subKey : subKey; + + try { + var validatedValue = valueValidator(subValue, subPath); + + if (validatedValue !== undefined) { + validatedObject[subKey] = validatedValue; + } + } catch (e) { + errors.push(e.message); + } + }); + + if (errors.length) { + throw new Error(errors.join("\n")); + } + + return validatedObject; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createMinimumValidator = (function (typeName, minimum) { + return function (value, path) { + assertValid(value >= minimum, value, path, typeName + " greater than or equal to " + minimum); + return value; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createNoUnknownFieldsValidator = (function (schema) { + return function (value, path) { + var errors = []; + Object.keys(value).forEach(function (subKey) { + if (!schema[subKey]) { + var subPath = path ? path + "." + subKey : subKey; + errors.push("'" + subPath + "': Unknown field."); + } + }); + + if (errors.length) { + throw new Error(errors.join("\n")); + } + + return value; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createNonEmptyValidator = (function (message) { + return function (value, path) { + if (isObject(value)) { + assertValid(!isEmptyObject(value), value, path, message); + } else { + assertValid(value.length > 0, value, path, message); + } + + return value; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createObjectOfValidator = (function (schema) { + return function (value, path) { + assertValid(isObject(value), value, path, "an object"); + var errors = []; + var validatedObject = {}; + Object.keys(schema).forEach(function (subKey) { + var subValue = value[subKey]; + var subSchema = schema[subKey]; + var subPath = path ? path + "." + subKey : subKey; + + try { + var validatedValue = subSchema(subValue, subPath); + + if (validatedValue !== undefined) { + validatedObject[subKey] = validatedValue; + } + } catch (e) { + errors.push(e.message); + } + }); // copy over unknown properties + + Object.keys(value).forEach(function (subKey) { + if (!Object.prototype.hasOwnProperty.call(validatedObject, subKey)) { + validatedObject[subKey] = value[subKey]; + } + }); + + if (errors.length) { + throw new Error(errors.join("\n")); + } + + return validatedObject; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createAnyOfValidator = (function (validators, message) { + return function (value, path) { + var valid = find(validators, function (validator) { + try { + validator(value, path); + return true; + } catch (e) { + return false; + } + }); + assertValid(valid, value, path, message); + return value; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createUniqueValidator = (function () { + var values = []; + return function (value, path) { + assertValid(values.indexOf(value) === -1, value, path, "a unique value across instances"); + values.push(value); + return value; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DOMAIN_REGEX = /^[a-z0-9.-]{1,}$/i; + var domainValidator = (function (value, path) { + assertValid(DOMAIN_REGEX.test(value), value, path, "a valid domain"); + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var integerValidator = (function (value, path) { + assertValid(isInteger(value), value, path, "an integer"); + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var numberValidator = (function (value, path) { + assertValid(isNumber(value), value, path, "a number"); + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Determines whether the value is a valid regular expression. + * @param {*} value + * @returns {boolean} + */ + var isValidRegExp = (function (value) { + try { + return new RegExp(value) !== null; + } catch (e) { + return false; + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var regexpValidator = (function (value, path) { + assertValid(isValidRegExp(value), value, path, "a regular expression"); + return value; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var requiredValidator = (function (value, path) { + if (value == null) { + throw new Error("'" + path + "' is a required option"); + } + + return value; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var stringValidator = (function (value, path) { + assertValid(isString(value), value, path, "a string"); + return value; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var base = function base(value) { + return value; + }; // The 'default' and 'required' methods are available after any data-type method + // Don't use the nullSafeChain because they need to handle the null or undefined case + + + base.default = function _default(defaultValue) { + return chain(this, createDefaultValidator(defaultValue)); + }; + + base.required = function required() { + return chain(this, requiredValidator); + }; // helper validators + + + var domain = function domain() { + return nullSafeChain(this, domainValidator); + }; + + var minimumInteger = function minimumInteger(minValue) { + return nullSafeChain(this, createMinimumValidator("an integer", minValue)); + }; + + var minimumNumber = function minimumNumber(minValue) { + return nullSafeChain(this, createMinimumValidator("a number", minValue)); + }; + + var integer = function integer() { + return nullSafeChain(this, integerValidator, { + minimum: minimumInteger + }); + }; + + var nonEmptyString = function nonEmptyString() { + return nullSafeChain(this, createNonEmptyValidator("a non-empty string")); + }; + + var nonEmptyArray = function nonEmptyArray() { + return nullSafeChain(this, createNonEmptyValidator("a non-empty array")); + }; + + var nonEmptyObject = function nonEmptyObject() { + return nullSafeChain(this, createNonEmptyValidator("a non-empty object")); + }; + + var regexp = function regexp() { + return nullSafeChain(this, regexpValidator); + }; + + var unique = function createUnique() { + return nullSafeChain(this, createUniqueValidator()); + }; // top-level validators. These are the first functions that are called to create a validator. + + + var anyOf = function anyOf(validators, message) { + // use chain here because we don't want to accept null or undefined unless at least + // one of the validators accept null or undefined. + return chain(this, createAnyOfValidator(validators, message)); + }; + + var anything = function anything() { + return nullSafeChain(this, base); + }; + + var arrayOf = function arrayOf(elementValidator) { + return nullSafeChain(this, createArrayOfValidator(elementValidator), { + nonEmpty: nonEmptyArray + }); + }; + + var boolean = function boolean() { + return nullSafeChain(this, booleanValidator); + }; + + var callback = function callback() { + return nullSafeChain(this, callbackValidator); + }; + + var literal = function literal(literalValue) { + return nullSafeChain(this, createLiteralValidator(literalValue)); + }; + + var number = function number() { + return nullSafeChain(this, numberValidator, { + minimum: minimumNumber, + integer: integer, + unique: unique + }); + }; + + var mapOfValues = function mapOfValues(valuesValidator) { + return nullSafeChain(this, createMapOfValuesValidator(valuesValidator), { + nonEmpty: nonEmptyObject + }); + }; + + var objectOf = function objectOf(schema) { + var noUnknownFields = function noUnknownFields() { + return nullSafeChain(this, createNoUnknownFieldsValidator(schema)); + }; + + return nullSafeChain(this, createObjectOfValidator(schema), { + noUnknownFields: noUnknownFields, + nonEmpty: nonEmptyObject + }); + }; + + var string = function string() { + return nullSafeChain(this, stringValidator, { + regexp: regexp, + domain: domain, + nonEmpty: nonEmptyString, + unique: unique + }); + }; + + var boundAnyOf = anyOf.bind(base); + var boundAnything = anything.bind(base); + var boundArrayOf = arrayOf.bind(base); + var boundBoolean = boolean.bind(base); + var boundCallback = callback.bind(base); + var boundLiteral = literal.bind(base); + number.bind(base); + var boundMapOfValues = mapOfValues.bind(base); + var boundObjectOf = objectOf.bind(base); + var boundString = string.bind(base); // compound validators + + var boundEnumOf = function boundEnumOf() { + for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) { + values[_key] = arguments[_key]; + } + + return boundAnyOf(values.map(boundLiteral), "one of these values: [" + JSON.stringify(values) + "]"); + }; + + var AMBIGUOUS = "ambiguous"; + var AUTHENTICATED = "authenticated"; + var LOGGED_OUT = "loggedOut"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var validateIdentityMap = boundMapOfValues(boundArrayOf(boundObjectOf({ + authenticatedState: boundEnumOf(AMBIGUOUS, AUTHENTICATED, LOGGED_OUT), + id: boundString(), + namespace: boundObjectOf({ + code: boundString() + }).noUnknownFields(), + primary: boundBoolean(), + xid: boundString() + })).required()); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns an array whose items are the provided object's own enumerable + * property values. + * @param {Object} obj + * @returns {Array} + */ + var values = (function (obj) { + return Object.keys(obj).map(function (key) { + return obj[key]; + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var debugQueryParam = "alloy_debug"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createLogController = (function (_ref) { + var console = _ref.console, + locationSearch = _ref.locationSearch, + createLogger = _ref.createLogger, + instanceName = _ref.instanceName, + createNamespacedStorage = _ref.createNamespacedStorage, + getMonitors = _ref.getMonitors; + var parsedQueryString = reactorQueryString.parse(locationSearch); + var storage = createNamespacedStorage("instance." + instanceName + "."); + var debugSessionValue = storage.session.getItem("debug"); + var debugEnabled = debugSessionValue === "true"; + var debugEnabledWritableFromConfig = debugSessionValue === null; + + var getDebugEnabled = function getDebugEnabled() { + return debugEnabled; + }; + + var setDebugEnabled = function setDebugEnabled(value, _ref2) { + var fromConfig = _ref2.fromConfig; + + if (!fromConfig || debugEnabledWritableFromConfig) { + debugEnabled = value; + } + + if (!fromConfig) { + // Web storage only allows strings, so we explicitly convert to string. + storage.session.setItem("debug", value.toString()); + debugEnabledWritableFromConfig = false; + } + }; + + if (parsedQueryString[debugQueryParam] !== undefined) { + setDebugEnabled(stringToBoolean(parsedQueryString[debugQueryParam]), { + fromConfig: false + }); + } + + return { + setDebugEnabled: setDebugEnabled, + logger: createLogger({ + getDebugEnabled: getDebugEnabled, + context: { + instanceName: instanceName + }, + getMonitors: getMonitors, + console: console + }), + createComponentLogger: function createComponentLogger(componentName) { + return createLogger({ + getDebugEnabled: getDebugEnabled, + context: { + instanceName: instanceName, + componentName: componentName + }, + getMonitors: getMonitors, + console: console + }); + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // TO-DOCUMENT: Lifecycle hooks and their params. + var hookNames = [// Called after all components have been registered. + "onComponentsRegistered", // Called before an event is sent on a data collection request + "onBeforeEvent", // Called before each request is made to the edge. + "onBeforeRequest", // Called after each response is returned from the edge with a successful + // status code + "onResponse", // Called after a network request to the edge fails. Either the request + // didn't make it to the edge, didn't make it to Konductor, or Konductor + // failed to return a regularly-structured response. (In this case { error } + // is passed as the parameter) + // Also called when the respone returns a 400 or 500 error. (In this case + // { response } is passed as the parameter) + "onRequestFailure", // A user clicked on an element. + "onClick"]; + + var createHook = function createHook(componentRegistry, hookName) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return Promise.all(componentRegistry.getLifecycleCallbacks(hookName).map(function (callback) { + return new Promise(function (resolve) { + resolve(callback.apply(void 0, args)); + }); + })); + }; + }; + /** + * This ensures that if a component's lifecycle method X + * attempts to execute lifecycle method Y, that all X methods on all components + * will have been called before any of their Y methods are called. It does + * this by kicking the call to the Y method to the next JavaScript tick. + * @returns {function} + */ + + + var guardHook = function guardHook(fn) { + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return Promise.resolve().then(function () { + return fn.apply(void 0, args); + }); + }; + }; + + var createLifecycle = (function (componentRegistry) { + return hookNames.reduce(function (memo, hookName) { + memo[hookName] = guardHook(createHook(componentRegistry, hookName)); + return memo; + }, {}); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var wrapForErrorHandling = function wrapForErrorHandling(fn, stackMessage) { + return function () { + var result; + + try { + result = fn.apply(void 0, arguments); + } catch (error) { + throw stackError({ + error: error, + message: stackMessage + }); + } + + if (result instanceof Promise) { + result = result.catch(function (error) { + throw stackError({ + error: error, + message: stackMessage + }); + }); + } + + return result; + }; + }; // TO-DOCUMENT: All public commands and their signatures. + + + var createComponentRegistry = (function () { + var componentsByNamespace = {}; + var commandsByName = {}; + var lifecycleCallbacksByName = {}; + + var registerComponentCommands = function registerComponentCommands(namespace) { + var componentCommandsByName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var conflictingCommandNames = intersection(Object.keys(commandsByName), Object.keys(componentCommandsByName)); + + if (conflictingCommandNames.length) { + throw new Error("[ComponentRegistry] Could not register " + namespace + " " + ("because it has existing command(s): " + conflictingCommandNames.join(","))); + } + + Object.keys(componentCommandsByName).forEach(function (commandName) { + var command = componentCommandsByName[commandName]; + command.commandName = commandName; + command.run = wrapForErrorHandling(command.run, "[" + namespace + "] An error occurred while executing the " + commandName + " command."); + commandsByName[commandName] = command; + }); + }; + + var registerLifecycleCallbacks = function registerLifecycleCallbacks(namespace) { + var componentLifecycleCallbacksByName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + Object.keys(componentLifecycleCallbacksByName).forEach(function (hookName) { + lifecycleCallbacksByName[hookName] = lifecycleCallbacksByName[hookName] || []; + lifecycleCallbacksByName[hookName].push(wrapForErrorHandling(componentLifecycleCallbacksByName[hookName], "[" + namespace + "] An error occurred while executing the " + hookName + " lifecycle hook.")); + }); + }; + + return { + register: function register(namespace, component) { + var commands = component.commands, + lifecycle = component.lifecycle; + registerComponentCommands(namespace, commands); + registerLifecycleCallbacks(namespace, lifecycle); + componentsByNamespace[namespace] = component; + }, + getCommand: function getCommand(commandName) { + return commandsByName[commandName]; + }, + getCommandNames: function getCommandNames() { + return Object.keys(commandsByName); + }, + getLifecycleCallbacks: function getLifecycleCallbacks(hookName) { + return lifecycleCallbacksByName[hookName] || []; + } + }; + }); + + var injectSendNetworkRequest = (function (_ref) { + var logger = _ref.logger, + sendFetchRequest = _ref.sendFetchRequest, + sendBeaconRequest = _ref.sendBeaconRequest, + isRequestRetryable = _ref.isRequestRetryable, + getRequestRetryDelay = _ref.getRequestRetryDelay; + + /** + * Send a network request and returns details about the response. + */ + return function (_ref2) { + var requestId = _ref2.requestId, + url = _ref2.url, + payload = _ref2.payload, + useSendBeacon = _ref2.useSendBeacon; + // We want to log raw payload and event data rather than + // our fancy wrapper objects. Calling payload.toJSON() is + // insufficient to get all the nested raw data, because it's + // not recursive (it doesn't call toJSON() on the event objects). + // Parsing the result of JSON.stringify(), however, gives the + // fully recursive raw data. + var stringifiedPayload = JSON.stringify(payload); + var parsedPayload = JSON.parse(stringifiedPayload); + logger.logOnBeforeNetworkRequest({ + url: url, + requestId: requestId, + payload: parsedPayload + }); + + var executeRequest = function executeRequest() { + var retriesAttempted = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var requestMethod = useSendBeacon ? sendBeaconRequest : sendFetchRequest; + return requestMethod(url, stringifiedPayload).then(function (response) { + var requestIsRetryable = isRequestRetryable({ + response: response, + retriesAttempted: retriesAttempted + }); + + if (requestIsRetryable) { + var requestRetryDelay = getRequestRetryDelay({ + response: response, + retriesAttempted: retriesAttempted + }); + return new Promise(function (resolve) { + setTimeout(function () { + resolve(executeRequest(retriesAttempted + 1)); + }, requestRetryDelay); + }); + } + + var parsedBody; + + try { + parsedBody = JSON.parse(response.body); + } catch (e) {// Non-JSON. Something went wrong. + } + + logger.logOnNetworkResponse(_objectSpread2(_objectSpread2({ + requestId: requestId, + url: url, + payload: parsedPayload + }, response), {}, { + parsedBody: parsedBody, + retriesAttempted: retriesAttempted + })); + return { + statusCode: response.statusCode, + body: response.body, + parsedBody: parsedBody, + getHeader: response.getHeader + }; + }); + }; + + return executeRequest().catch(function (error) { + logger.logOnNetworkError({ + requestId: requestId, + url: url, + payload: parsedPayload, + error: error + }); + throw stackError({ + error: error, + message: "Network request failed." + }); + }); + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectExtractEdgeInfo = (function (_ref) { + var logger = _ref.logger; + return function (adobeEdgeHeader) { + if (adobeEdgeHeader) { + var headerParts = adobeEdgeHeader.split(";"); + + if (headerParts.length >= 2 && headerParts[1].length > 0) { + try { + var regionId = parseInt(headerParts[1], 10); // eslint recommends using Number.isNaN instead, but this function is + // not available in Internet Explorer. Number.isNaN is more robust to + // non-numeric parameters. Since we already know regionId will be an + // integer, using isNaN is okay. + // https://github.com/airbnb/javascript#standard-library--isnan + // eslint-disable-next-line no-restricted-globals + + if (!isNaN(regionId)) { + return { + regionId: regionId + }; + } + } catch (e) {// No need to do anything. The log statement below will log an error + } + } + + logger.warn("Invalid adobe edge: \"" + adobeEdgeHeader + "\""); + } + + return {}; + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var IN = "in"; + var OUT = "out"; + var PENDING = "pending"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var GENERAL = "general"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DECLINED_CONSENT_ERROR_CODE = "declinedConsent"; + var CONSENT_SOURCE_DEFAULT = "default"; + var CONSENT_SOURCE_INITIAL = "initial"; + var CONSENT_SOURCE_NEW = "new"; + + var createDeclinedConsentError = function createDeclinedConsentError(errorMessage) { + var error = new Error(errorMessage); + error.code = DECLINED_CONSENT_ERROR_CODE; + error.message = errorMessage; + return error; + }; + + var createConsentStateMachine = (function (_ref) { + var logger = _ref.logger; + var deferreds = []; + + var runAll = function runAll() { + while (deferreds.length) { + deferreds.shift().resolve(); + } + }; + + var discardAll = function discardAll() { + while (deferreds.length) { + deferreds.shift().reject(createDeclinedConsentError("The user declined consent.")); + } + }; + + var awaitInitial = function awaitInitial() { + return Promise.reject(new Error("Consent has not been initialized.")); + }; + + var awaitInDefault = function awaitInDefault() { + return Promise.resolve(); + }; + + var awaitIn = function awaitIn() { + return Promise.resolve(); + }; + + var awaitOutDefault = function awaitOutDefault() { + return Promise.reject(createDeclinedConsentError("No consent preferences have been set.")); + }; + + var awaitOut = function awaitOut() { + return Promise.reject(createDeclinedConsentError("The user declined consent.")); + }; + + var awaitPending = function awaitPending() { + var deferred = defer(); + deferreds.push(deferred); + return deferred.promise; + }; + + return { + in: function _in(source) { + if (source === CONSENT_SOURCE_DEFAULT) { + this.awaitConsent = awaitInDefault; + } else { + if (source === CONSENT_SOURCE_INITIAL) { + logger.info("Loaded user consent preferences. The user previously consented."); + } else if (source === CONSENT_SOURCE_NEW && this.awaitConsent !== awaitIn) { + logger.info("User consented."); + } + + runAll(); + this.awaitConsent = awaitIn; + } + }, + out: function out(source) { + if (source === CONSENT_SOURCE_DEFAULT) { + logger.warn("User consent preferences not found. Default consent of out will be used."); + this.awaitConsent = awaitOutDefault; + } else { + if (source === CONSENT_SOURCE_INITIAL) { + logger.warn("Loaded user consent preferences. The user previously declined consent."); + } else if (source === CONSENT_SOURCE_NEW && this.awaitConsent !== awaitOut) { + logger.warn("User declined consent."); + } + + discardAll(); + this.awaitConsent = awaitOut; + } + }, + pending: function pending(source) { + if (source === CONSENT_SOURCE_DEFAULT) { + logger.info("User consent preferences not found. Default consent of pending will be used. Some commands may be delayed."); + } + + this.awaitConsent = awaitPending; + }, + awaitConsent: awaitInitial + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createConsent = (function (_ref) { + var generalConsentState = _ref.generalConsentState, + logger = _ref.logger; + + var _setConsent = function setConsent(consentByPurpose, source) { + switch (consentByPurpose[GENERAL]) { + case IN: + generalConsentState.in(source); + break; + + case OUT: + generalConsentState.out(source); + break; + + case PENDING: + generalConsentState.pending(source); + break; + + default: + logger.warn("Unknown consent value: " + consentByPurpose[GENERAL]); + break; + } + }; + + return { + initializeConsent: function initializeConsent(defaultConsentByPurpose, storedConsentByPurpose) { + if (storedConsentByPurpose[GENERAL]) { + _setConsent(storedConsentByPurpose, CONSENT_SOURCE_INITIAL); + } else { + _setConsent(defaultConsentByPurpose, CONSENT_SOURCE_DEFAULT); + } + }, + setConsent: function setConsent(consentByPurpose) { + _setConsent(consentByPurpose, CONSENT_SOURCE_NEW); + }, + suspend: function suspend() { + generalConsentState.pending(); + }, + awaitConsent: function awaitConsent() { + return generalConsentState.awaitConsent(); + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createEvent = (function () { + var content = {}; + var userXdm; + var userData; + var _documentMayUnload = false; + var isFinalized = false; + var shouldSendEvent = true; + + var throwIfEventFinalized = function throwIfEventFinalized(methodName) { + if (isFinalized) { + throw new Error(methodName + " cannot be called after event is finalized."); + } + }; + + var event = { + setUserXdm: function setUserXdm(value) { + throwIfEventFinalized("setUserXdm"); + userXdm = value; + }, + setUserData: function setUserData(value) { + throwIfEventFinalized("setUserData"); + userData = value; + }, + mergeXdm: function mergeXdm(xdm) { + throwIfEventFinalized("mergeXdm"); + + if (xdm) { + deepAssign(content, { + xdm: xdm + }); + } + }, + mergeMeta: function mergeMeta(meta) { + throwIfEventFinalized("mergeMeta"); + + if (meta) { + deepAssign(content, { + meta: meta + }); + } + }, + mergeQuery: function mergeQuery(query) { + throwIfEventFinalized("mergeQuery"); + + if (query) { + deepAssign(content, { + query: query + }); + } + }, + documentMayUnload: function documentMayUnload() { + _documentMayUnload = true; + }, + finalize: function finalize(onBeforeEventSend) { + if (isFinalized) { + return; + } + + if (userXdm) { + event.mergeXdm(userXdm); + } + + if (userData) { + content.data = userData; + } // the event should already be considered finalized in case onBeforeEventSend throws an error + + + isFinalized = true; + + if (onBeforeEventSend) { + // assume that the onBeforeEventSend callback will fail (in-case of an error) + shouldSendEvent = false; // this allows the user to replace the xdm and data properties + // on the object passed to the callback + + var tempContent = { + xdm: content.xdm || {}, + data: content.data || {} + }; + var result = onBeforeEventSend(tempContent); + shouldSendEvent = result !== false; + content.xdm = tempContent.xdm || {}; + content.data = tempContent.data || {}; + + if (isEmptyObject(content.xdm)) { + delete content.xdm; + } + + if (isEmptyObject(content.data)) { + delete content.data; + } + } + }, + getDocumentMayUnload: function getDocumentMayUnload() { + return _documentMayUnload; + }, + isEmpty: function isEmpty() { + return isEmptyObject(content) && (!userXdm || isEmptyObject(userXdm)) && (!userData || isEmptyObject(userData)); + }, + shouldSend: function shouldSend() { + return shouldSendEvent; + }, + getViewName: function getViewName() { + if (!userXdm || !userXdm.web || !userXdm.web.webPageDetails) { + return undefined; + } + + return userXdm.web.webPageDetails.viewName; + }, + toJSON: function toJSON() { + if (!isFinalized) { + throw new Error("toJSON called before finalize"); + } + + return content; + } + }; + return event; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var RETRY_AFTER = "Retry-After"; + var ADOBE_EDGE = "x-adobe-edge"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Creates a representation of a gateway response with the addition of + * helper methods. + * @returns Response + */ + + var injectCreateResponse = (function (_ref) { + var extractEdgeInfo = _ref.extractEdgeInfo; + return function (_ref2) { + var _ref2$content = _ref2.content, + content = _ref2$content === void 0 ? {} : _ref2$content, + getHeader = _ref2.getHeader; + var _content$handle = content.handle, + handle = _content$handle === void 0 ? [] : _content$handle, + _content$errors = content.errors, + errors = _content$errors === void 0 ? [] : _content$errors, + _content$warnings = content.warnings, + warnings = _content$warnings === void 0 ? [] : _content$warnings; + /** + * Response object. + * @typedef {Object} Response + */ + + return { + /** + * Returns matching fragments of the response by type. + * @param {String} type A string with the current format: + * + * @example + * getPayloadsByType("identity:persist") + */ + getPayloadsByType: function getPayloadsByType(type) { + return flatMap(handle.filter(function (fragment) { + return fragment.type === type; + }), function (fragment) { + return fragment.payload; + }); + }, + + /** + * Returns all errors. + */ + getErrors: function getErrors() { + return errors; + }, + + /** + * Returns all warnings. + */ + getWarnings: function getWarnings() { + return warnings; + }, + + /** + * Returns an object containing the regionId from the x-adobe-edge header + */ + getEdge: function getEdge() { + return extractEdgeInfo(getHeader(ADOBE_EDGE)); + }, + toJSON: function toJSON() { + return content; + } + }; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var coreCommands = { + CONFIGURE: "configure", + SET_DEBUG: "setDebug" + }; + var injectExecuteCommand = (function (_ref) { + var logger = _ref.logger, + configureCommand = _ref.configureCommand, + setDebugCommand = _ref.setDebugCommand, + handleError = _ref.handleError, + validateCommandOptions = _ref.validateCommandOptions; + var configurePromise; + + var getExecutor = function getExecutor(commandName, options) { + var executor; + + if (commandName === coreCommands.CONFIGURE) { + if (configurePromise) { + throw new Error("The library has already been configured and may only be configured once."); + } + + executor = function executor() { + configurePromise = configureCommand(options); + return configurePromise.then(function () {// Don't expose internals to the user. + }); + }; + } else { + if (!configurePromise) { + throw new Error("The library must be configured first. Please do so by executing the configure command."); + } + + if (commandName === coreCommands.SET_DEBUG) { + executor = function executor() { + return setDebugCommand(options); + }; + } else { + executor = function executor() { + return configurePromise.then(function (componentRegistry) { + var command = componentRegistry.getCommand(commandName); + + if (!command || !isFunction(command.run)) { + var commandNames = values(coreCommands).concat(componentRegistry.getCommandNames()).join(", "); + throw new Error("The " + commandName + " command does not exist. List of available commands: " + commandNames + "."); + } + + var validatedOptions = validateCommandOptions({ + command: command, + options: options + }); + return command.run(validatedOptions); + }, function () { + logger.warn("An error during configuration is preventing the " + commandName + " command from executing."); // If configuration failed, we prevent the configuration + // error from bubbling here because we don't want the + // configuration error to be reported in the console every + // time any command is executed. Only having it bubble + // once when the configure command runs is sufficient. + // Instead, for this command, we'll just return a promise + // that never gets resolved. + + return new Promise(function () {}); + }); + }; + } + } + + return executor; + }; + + return function (commandName) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return new Promise(function (resolve) { + // We have to wrap the getExecutor() call in the promise so the promise + // will be rejected if getExecutor() throws errors. + var executor = getExecutor(commandName, options); + logger.logOnBeforeCommand({ + commandName: commandName, + options: options + }); + resolve(executor()); + }).catch(function (error) { + return handleError(error, commandName + " command"); + }).catch(function (error) { + logger.logOnCommandRejected({ + commandName: commandName, + options: options, + error: error + }); + throw error; + }).then(function (rawResult) { + // We should always be returning an object from every command. + var result = isObject(rawResult) ? rawResult : {}; + logger.logOnCommandResolved({ + commandName: commandName, + options: options, + result: result + }); + return result; + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var COMMAND_DOC_URI = "https://adobe.ly/3sHgQHb"; + var validateCommandOptions = (function (_ref) { + var command = _ref.command, + options = _ref.options; + var commandName = command.commandName, + _command$documentatio = command.documentationUri, + documentationUri = _command$documentatio === void 0 ? COMMAND_DOC_URI : _command$documentatio, + optionsValidator = command.optionsValidator; + var validatedOptions = options; + + if (optionsValidator) { + try { + validatedOptions = optionsValidator(options); + } catch (validationError) { + var invalidOptionsMessage = "Invalid " + commandName + " command options:\n\t - " + validationError + " For command documentation see: " + documentationUri; + throw new Error(invalidOptionsMessage); + } + } + + return validatedOptions; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Verifies user provided event options. + * @param {*} options The user event options to validate + * @returns {*} Validated options + */ + + var validateUserEventOptions = (function (_ref) { + var options = _ref.options; + var eventOptionsValidator = boundObjectOf({ + type: boundString(), + xdm: boundObjectOf({ + eventType: boundString(), + identityMap: validateIdentityMap + }), + data: boundObjectOf({}), + renderDecisions: boundBoolean(), + decisionScopes: boundArrayOf(boundString()), + datasetId: boundString() + }).required(); + return eventOptionsValidator(options); + }); + + var validateServerState = (function (_ref) { + var options = _ref.options; + var validator = boundObjectOf({ + renderDecisions: boundBoolean(), + request: boundObjectOf({ + headers: boundAnything().required(), + body: boundAnything().required() + }).required(), + response: boundObjectOf({ + headers: boundAnything().required(), + body: boundAnything().required() + }).required() + }); + return validator(options); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createDataCollector = function createDataCollector(_ref) { + var eventManager = _ref.eventManager; + return { + commands: { + sendEvent: { + documentationUri: "https://adobe.ly/3GQ3Q7t", + optionsValidator: function optionsValidator(options) { + return validateUserEventOptions({ + options: options + }); + }, + run: function run(options) { + var xdm = options.xdm, + data = options.data, + _options$documentUnlo = options.documentUnloading, + documentUnloading = _options$documentUnlo === void 0 ? false : _options$documentUnlo, + type = options.type, + mergeId = options.mergeId, + _options$renderDecisi = options.renderDecisions, + renderDecisions = _options$renderDecisi === void 0 ? false : _options$renderDecisi, + _options$decisionScop = options.decisionScopes, + decisionScopes = _options$decisionScop === void 0 ? [] : _options$decisionScop, + datasetId = options.datasetId; + var event = eventManager.createEvent(); + + if (documentUnloading) { + event.documentMayUnload(); + } + + event.setUserXdm(xdm); + event.setUserData(data); + + if (type) { + event.mergeXdm({ + eventType: type + }); + } + + if (mergeId) { + event.mergeXdm({ + eventMergeId: mergeId + }); + } + + if (datasetId) { + event.mergeMeta({ + collect: { + datasetId: datasetId + } + }); + } + + return eventManager.sendEvent(event, { + renderDecisions: renderDecisions, + decisionScopes: decisionScopes + }); + } + }, + applyEvents: { + documentationUri: "", + optionsValidator: function optionsValidator(serverState) { + return validateServerState({ + options: serverState + }); + }, + run: function run(serverState) { + var _serverState$request = serverState.request, + request = _serverState$request === void 0 ? {} : _serverState$request, + _serverState$renderDe = serverState.renderDecisions, + renderDecisions = _serverState$renderDe === void 0 ? false : _serverState$renderDe; + var _request$body$events = request.body.events, + fulfilledEvents = _request$body$events === void 0 ? [] : _request$body$events; + return Promise.all(fulfilledEvents.map(function (fulfilledEvent) { + var event = eventManager.createEvent(); + var _fulfilledEvent$xdm = fulfilledEvent.xdm, + xdm = _fulfilledEvent$xdm === void 0 ? {} : _fulfilledEvent$xdm, + _fulfilledEvent$query = fulfilledEvent.query, + query = _fulfilledEvent$query === void 0 ? { + personalization: { + decisionScopes: [] + } + } : _fulfilledEvent$query, + _fulfilledEvent$data = fulfilledEvent.data, + data = _fulfilledEvent$data === void 0 ? {} : _fulfilledEvent$data; + var decisionScopes = query.personalization.decisionScopes; + event.setUserXdm(xdm); + event.setUserData(data); + return eventManager.sendEvent(event, { + renderDecisions: renderDecisions, + decisionScopes: decisionScopes, + serverState: serverState + }); + })); + } + } + } + }; + }; + + createDataCollector.namespace = "DataCollector"; + createDataCollector.configValidators = {}; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createClickHandler = function createClickHandler(_ref) { + var eventManager = _ref.eventManager, + lifecycle = _ref.lifecycle, + handleError = _ref.handleError; + return function (clickEvent) { + // TODO: Consider safeguarding from the same object being clicked multiple times in rapid succession? + var clickedElement = clickEvent.target; + var event = eventManager.createEvent(); + return lifecycle.onClick({ + event: event, + clickedElement: clickedElement + }).then(function () { + if (event.isEmpty()) { + return Promise.resolve(); + } + + return eventManager.sendEvent(event); + }) // eventManager.sendEvent() will return a promise resolved to an + // object and we want to avoid returning any value to the customer + .then(noop$1).catch(function (error) { + handleError(error, "click collection"); + }); + }; + }; + + var attachClickActivityCollector = (function (_ref2) { + var config = _ref2.config, + eventManager = _ref2.eventManager, + lifecycle = _ref2.lifecycle, + handleError = _ref2.handleError; + var enabled = config.clickCollectionEnabled; + + if (!enabled) { + return; + } + + var clickHandler = createClickHandler({ + eventManager: eventManager, + lifecycle: lifecycle, + handleError: handleError + }); + document.addEventListener("click", clickHandler, true); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var configValidators$1 = { + clickCollectionEnabled: boundBoolean().default(true), + downloadLinkQualifier: boundString().regexp().default("\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$") + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var urlStartsWithScheme = function urlStartsWithScheme(url) { + return url && /^[a-z0-9]+:\/\//i.test(url); + }; + + var getAbsoluteUrlFromAnchorElement = function getAbsoluteUrlFromAnchorElement(window, element) { + var loc = window.location; + var url = element.href ? element.href : ""; + var protocol = element.protocol, + host = element.host; + + if (!urlStartsWithScheme(url)) { + if (!protocol) { + protocol = loc.protocol ? loc.protocol : ""; + } + + protocol = protocol ? protocol + "//" : ""; + + if (!host) { + host = loc.host ? loc.host : ""; + } + + var path = ""; + + if (url.substring(0, 1) !== "/") { + var indx = loc.pathname.lastIndexOf("/"); + indx = indx < 0 ? 0 : indx; + path = loc.pathname.substring(0, indx); + } + + url = "" + protocol + host + path + "/" + url; + } + + return url; + }; + + var isSupportedAnchorElement = function isSupportedAnchorElement(element) { + if (element.href && (element.tagName === "A" || element.tagName === "AREA") && (!element.onclick || !element.protocol || element.protocol.toLowerCase().indexOf("javascript") < 0)) { + return true; + } + + return false; + }; + + var isDownloadLink = function isDownloadLink(downloadLinkQualifier, linkUrl, clickedObj) { + var re = new RegExp(downloadLinkQualifier); + return clickedObj.download ? true : re.test(linkUrl.toLowerCase()); + }; + + var isExitLink = function isExitLink(window, linkUrl) { + var currentHostname = window.location.hostname.toLowerCase(); + + if (linkUrl.toLowerCase().indexOf(currentHostname) >= 0) { + return false; + } + + return true; + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var determineLinkType = function determineLinkType(window, config, linkUrl, clickedObj) { + var linkType = "other"; + + if (isDownloadLink(config.downloadLinkQualifier, linkUrl, clickedObj)) { + linkType = "download"; + } else if (isExitLink(window, linkUrl)) { + linkType = "exit"; + } + + return linkType; + }; + + var findSupportedAnchorElement = function findSupportedAnchorElement(targetElement) { + var node = targetElement; + + while (node) { + if (isSupportedAnchorElement(node)) { + return node; + } + + node = node.parentNode; + } + + return null; + }; + + var createLinkClick = (function (window, config) { + return function (event, targetElement) { + // Search parent elements for an anchor element + // TODO: Replace with generic DOM tool that can fetch configured properties + var anchorElement = findSupportedAnchorElement(targetElement); + + if (!anchorElement) { + return; + } + + var linkUrl = getAbsoluteUrlFromAnchorElement(window, anchorElement); + + if (!linkUrl) { + return; + } + + var linkType = determineLinkType(window, config, linkUrl, anchorElement); // TODO: Update link name from the clicked element context + + var linkName = "Link Click"; + event.documentMayUnload(); + event.mergeXdm({ + eventType: "web.webinteraction.linkClicks", + web: { + webInteraction: { + name: linkName, + type: linkType, + URL: linkUrl, + linkClicks: { + value: 1 + } + } + } + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createActivityCollector = function createActivityCollector(_ref) { + var config = _ref.config, + eventManager = _ref.eventManager, + handleError = _ref.handleError; + var linkClick = createLinkClick(window, config); + return { + lifecycle: { + onComponentsRegistered: function onComponentsRegistered(tools) { + var lifecycle = tools.lifecycle; + attachClickActivityCollector({ + config: config, + eventManager: eventManager, + lifecycle: lifecycle, + handleError: handleError + }); // TODO: createScrollActivityCollector ... + }, + onClick: function onClick(_ref2) { + var event = _ref2.event, + clickedElement = _ref2.clickedElement; + linkClick(event, clickedElement); + } + } + }; + }; + + createActivityCollector.namespace = "ActivityCollector"; + createActivityCollector.configValidators = configValidators$1; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createResultLogMessage$1 = function createResultLogMessage(idSync, success) { + return "ID sync " + (success ? "succeeded" : "failed") + ": " + idSync.spec.url; + }; + + var injectProcessIdSyncs = (function (_ref) { + var fireReferrerHideableImage = _ref.fireReferrerHideableImage, + logger = _ref.logger; + return function (idSyncs) { + var urlIdSyncs = idSyncs.filter(function (idSync) { + return idSync.type === "url"; + }); + + if (!urlIdSyncs.length) { + return Promise.resolve(); + } + + return Promise.all(urlIdSyncs.map(function (idSync) { + return fireReferrerHideableImage(idSync.spec).then(function () { + logger.info(createResultLogMessage$1(idSync, true)); + }).catch(function () { + // We intentionally do not throw an error if id syncs fail. We + // consider it a non-critical failure and therefore do not want it to + // reject the promise handed back to the customer. + logger.error(createResultLogMessage$1(idSync, false)); + }); + })).then(noop$1); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var configValidators = { + thirdPartyCookiesEnabled: boundBoolean().default(true), + idMigrationEnabled: boundBoolean().default(true) + }; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Verifies user provided event options. + * @param {*} options The user event options to validate + * @returns {*} Validated options + */ + + var getIdentityOptionsValidator = (function (options) { + var getIdentityOptionsValidator = boundObjectOf({ + namespaces: boundArrayOf(boundLiteral("ECID")).nonEmpty() + }).noUnknownFields(); + getIdentityOptionsValidator(options); // Return default options for now + // To-Do: Accept namespace from given options + + return { + namespaces: ["ECID"] + }; + }); + + var createComponent$4 = (function (_ref) { + var addEcidQueryToPayload = _ref.addEcidQueryToPayload, + ensureSingleIdentity = _ref.ensureSingleIdentity, + setLegacyEcid = _ref.setLegacyEcid, + handleResponseForIdSyncs = _ref.handleResponseForIdSyncs, + getEcidFromResponse = _ref.getEcidFromResponse, + getIdentity = _ref.getIdentity, + consent = _ref.consent; + var ecid; + var edge = {}; + return { + lifecycle: { + onBeforeRequest: function onBeforeRequest(_ref2) { + var request = _ref2.request, + onResponse = _ref2.onResponse, + onRequestFailure = _ref2.onRequestFailure; + // Querying the ECID on every request to be able to set the legacy cookie, and make it + // available for the `getIdentity` command. + addEcidQueryToPayload(request.getPayload()); + return ensureSingleIdentity({ + request: request, + onResponse: onResponse, + onRequestFailure: onRequestFailure + }); + }, + onResponse: function onResponse(_ref3) { + var response = _ref3.response; + + if (!ecid) { + ecid = getEcidFromResponse(response); // Only data collection calls will have an ECID in the response. + // https://jira.corp.adobe.com/browse/EXEG-1234 + + if (ecid) { + setLegacyEcid(ecid); + } + } // For sendBeacon requests, getEdge() will return {}, so we are using assign here + // so that sendBeacon requests don't override the edge info from before. + + + edge = reactorObjectAssign(edge, response.getEdge()); + return handleResponseForIdSyncs(response); + } + }, + commands: { + getIdentity: { + optionsValidator: getIdentityOptionsValidator, + run: function run(options) { + return consent.awaitConsent().then(function () { + return ecid ? undefined : getIdentity(options.namespaces); + }).then(function () { + return { + identity: { + ECID: ecid + }, + edge: edge + }; + }); + } + } + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // Maybe default the domain in the cookieJar to apex while allowing overrides. + + var apexDomain$1 = getApexDomain(window, reactorCookie); + /** + * Handles migration of ECID to and from Visitor.js. + */ + + var createLegacyIdentity = (function (_ref) { + var config = _ref.config, + getEcidFromVisitor = _ref.getEcidFromVisitor; + var idMigrationEnabled = config.idMigrationEnabled, + orgId = config.orgId; + var amcvCookieName = "AMCV_" + orgId; + + var getEcidFromLegacyCookies = function getEcidFromLegacyCookies() { + var ecid = null; + var secidCookieName = "s_ecid"; + var legacyEcidCookieValue = reactorCookie.get(secidCookieName) || reactorCookie.get(amcvCookieName); + + if (legacyEcidCookieValue) { + var reg = /(^|\|)MCMID\|(\d+)($|\|)/; + var matches = legacyEcidCookieValue.match(reg); + + if (matches) { + // Destructuring arrays breaks in IE + ecid = matches[2]; + } + } + + return ecid; + }; + + return { + getEcid: function getEcid() { + if (idMigrationEnabled) { + var ecid = getEcidFromLegacyCookies(); + + if (ecid) { + return Promise.resolve(ecid); + } + + return getEcidFromVisitor(); + } + + return Promise.resolve(); + }, + setEcid: function setEcid(ecid) { + if (idMigrationEnabled && !reactorCookie.get(amcvCookieName)) { + reactorCookie.set(amcvCookieName, "MCMID|" + ecid, { + domain: apexDomain$1, + // Without `expires` this will be a session cookie. + expires: 390 // days, or 13 months. + + }); + } + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var awaitVisitorOptIn = (function (_ref) { + var logger = _ref.logger; + return new Promise(function (resolve, reject) { + if (isObject(window.adobe) && isObject(window.adobe.optIn)) { + var optInOld = window.adobe.optIn; + logger.info("Delaying request while waiting for legacy opt-in to let Visitor retrieve ECID from server."); + optInOld.fetchPermissions(function () { + if (optInOld.isApproved([optInOld.Categories.ECID])) { + logger.info("Received legacy opt-in approval to let Visitor retrieve ECID from server."); + resolve(); + } else { + reject(new Error("Legacy opt-in was declined.")); + } + }, true); + } else { + resolve(); + } + }); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getVisitor = (function (window) { + var Visitor = window.Visitor; + return isFunction(Visitor) && isFunction(Visitor.getInstance) && Visitor; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectGetEcidFromVisitor = (function (_ref) { + var logger = _ref.logger, + orgId = _ref.orgId, + awaitVisitorOptIn = _ref.awaitVisitorOptIn; + var Visitor = getVisitor(window); + return function () { + if (Visitor) { + // Need to explicitly wait for optIn because visitor will call callback + // with invalid values prior to optIn being approved + return awaitVisitorOptIn({ + logger: logger + }).then(function () { + logger.info("Delaying request while using Visitor to retrieve ECID from server."); + return new Promise(function (resolve) { + var visitor = Visitor.getInstance(orgId, {}); + visitor.getMarketingCloudVisitorID(function (ecid) { + logger.info("Resuming previously delayed request that was waiting for ECID from Visitor."); + resolve(ecid); + }, true); + }); + }).catch(function (error) { + // If consent was denied, get the ECID from experience edge. OptIn and AEP Web SDK + // consent should operate independently, but during id migration AEP Web SDK needs + // to wait for optIn object consent resolution so that only one ECID is generated. + if (error) { + logger.info(error.message + ", retrieving ECID from experience edge"); + } else { + logger.info("An error occurred while obtaining the ECID from Visitor."); + } + }); + } + + return Promise.resolve(); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectHandleResponseForIdSyncs = (function (_ref) { + var processIdSyncs = _ref.processIdSyncs; + return function (response) { + return processIdSyncs(response.getPayloadsByType("identity:exchange")); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // TO-DOCUMENT: We queue subsequent requests until we have an identity cookie. + var injectEnsureSingleIdentity = (function (_ref) { + var doesIdentityCookieExist = _ref.doesIdentityCookieExist, + setDomainForInitialIdentityPayload = _ref.setDomainForInitialIdentityPayload, + addLegacyEcidToPayload = _ref.addLegacyEcidToPayload, + awaitIdentityCookie = _ref.awaitIdentityCookie, + logger = _ref.logger; + var obtainedIdentityPromise; + + var allowRequestToGoWithoutIdentity = function allowRequestToGoWithoutIdentity(request) { + setDomainForInitialIdentityPayload(request); + return addLegacyEcidToPayload(request.getPayload()); + }; + /** + * Ensures that if no identity cookie exists, we only let one request at a + * time without an identity until its response returns. In the meantime, + * we queue all other requests, otherwise the requests could result in + * multiple ECIDs being minted for the user. Once we get an identity + * cookie, we can let the queued requests be sent all at once, since they + * will have the newly minted ECID. + * + * Konductor should make every effort to return an identity, but in + * certain scenarios it may not. For example, in cases where the + * request does not match what Konductor is expecting (ie 400s). + * In cases where Konductor does not set an identity, there should be + * no events recorded so we don't need to worry about multiple ECIDs + * being minted for each user. + * + * The reason we allow for multiple sequential requests to be sent without + * an identity is to prevent a single malformed request causing all other + * requests to never send. + */ + + + return function (_ref2) { + var request = _ref2.request, + onResponse = _ref2.onResponse, + onRequestFailure = _ref2.onRequestFailure; + + if (doesIdentityCookieExist()) { + request.setIsIdentityEstablished(); + return Promise.resolve(); + } + + if (obtainedIdentityPromise) { + // We don't have an identity cookie, but at least one request has + // been sent to get it. Konductor may set the identity cookie in the + // response. We will hold up this request until the last request + // requiring identity returns and awaitIdentityCookie confirms the + // identity was set. + logger.info("Delaying request while retrieving ECID from server."); + var previousObtainedIdentityPromise = obtainedIdentityPromise; // This promise resolves when we have an identity cookie. Additional + // requests are chained together so that only one is sent at a time + // until we have the identity cookie. + + obtainedIdentityPromise = previousObtainedIdentityPromise.catch(function () { + return awaitIdentityCookie({ + onResponse: onResponse, + onRequestFailure: onRequestFailure + }); + }); // When this returned promise resolves, the request will go out. + + return previousObtainedIdentityPromise.then(function () { + logger.info("Resuming previously delayed request."); + request.setIsIdentityEstablished(); + }) // If Konductor did not set the identity cookie on the previous + // request, then awaitIdentityCookie will reject its promise. + // Catch the rejection here and allow this request to go out. + .catch(function () { + return allowRequestToGoWithoutIdentity(request); + }); + } // For Alloy+Konductor communication to be as robust as possible and + // to ensure we don't mint new ECIDs for requests that would otherwise + // be sent in parallel, we'll let this request go out to fetch the + // cookie + + + obtainedIdentityPromise = awaitIdentityCookie({ + onResponse: onResponse, + onRequestFailure: onRequestFailure + }); + return allowRequestToGoWithoutIdentity(request); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var ecidNamespace = "ECID"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var addEcidQueryToPayload = (function (payload) { + payload.mergeQuery({ + identity: { + fetch: [ecidNamespace] + } + }); + }); + + var matchUserAgent = function matchUserAgent(regexs) { + return function (userAgent) { + var keys = Object.keys(regexs); + + for (var i = 0; i < keys.length; i += 1) { + var key = keys[i]; + var regex = regexs[key]; + + if (regex.test(userAgent)) { + return key; + } + } + + return UNKNOWN; + }; + }; + + var getBrowser = memoize(function (window) { + var _matchUserAgent; + + return matchUserAgent((_matchUserAgent = {}, _defineProperty(_matchUserAgent, EDGE$1, /Edge\/([0-9\._]+)/), _defineProperty(_matchUserAgent, EDGE_CHROMIUM, /Edg\/([0-9\.]+)/), _defineProperty(_matchUserAgent, CHROME, /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/), _defineProperty(_matchUserAgent, FIREFOX, /Firefox\/([0-9\.]+)(?:\s|$)/), _defineProperty(_matchUserAgent, IE, /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/), _defineProperty(_matchUserAgent, SAFARI, /Version\/([0-9\._]+).*Safari/), _matchUserAgent))(window.navigator.userAgent); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectSetDomainForInitialIdentityPayload = (function (_ref) { + var thirdPartyCookiesEnabled = _ref.thirdPartyCookiesEnabled, + areThirdPartyCookiesSupportedByDefault = _ref.areThirdPartyCookiesSupportedByDefault; + return function (request) { + if (thirdPartyCookiesEnabled && areThirdPartyCookiesSupportedByDefault(getBrowser(window))) { + // If third-party cookies are enabled by the customer and + // supported by the browser, we will send the request to a + // a third-party identification domain that allows for more accurate + // identification of the user through use of a third-party cookie. + // If we have an identity to migrate, we still want to hit the + // third-party identification domain because the third-party identification + // domain will use our ECID to set the third-party cookie if the third-party + // cookie isn't already set, which provides for better cross-domain + // identification for future requests. + request.setUseIdThirdPartyDomain(); + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectAddLegacyEcidToPayload = (function (_ref) { + var getLegacyEcid = _ref.getLegacyEcid, + addEcidToPayload = _ref.addEcidToPayload; + return function (payload) { + return getLegacyEcid().then(function (ecidToMigrate) { + if (ecidToMigrate) { + addEcidToPayload(payload, ecidToMigrate); + } + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var addEcidToPayload = (function (payload, ecid) { + payload.addIdentity(ecidNamespace, { + id: ecid + }); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectAwaitIdentityCookie = (function (_ref) { + var doesIdentityCookieExist = _ref.doesIdentityCookieExist, + orgId = _ref.orgId; + + /** + * Returns a promise that will be resolved once an identity cookie exists. + * If an identity cookie doesn't already exist, it should always exist after + * the first response. + */ + return function (_ref2) { + var onResponse = _ref2.onResponse, + onRequestFailure = _ref2.onRequestFailure; + return new Promise(function (resolve, reject) { + onResponse(function () { + if (doesIdentityCookieExist()) { + resolve(); + } else { + // This logic assumes that the code setting the cookie is working as expected and that + // the cookie was missing from the response. + var noIdentityCookieError = new Error("An identity was not set properly. Please verify that the org ID " + orgId + " configured in Alloy matches the org ID specified in the edge configuration."); // Rejecting the promise will reject commands that were queued + // by the Identity component while waiting on the response to + // the initial request. + + reject(noIdentityCookieError); // Throwing an error will reject the event command that initiated + // the request. + + throw noIdentityCookieError; + } + }); + onRequestFailure(function () { + if (doesIdentityCookieExist()) { + resolve(); + } else { + // The error from the request failure will be logged separately. Rejecting this here + // will tell ensureSingleIdentity to send the next request without identity + reject(new Error("No identity was set on response.")); + } + }); + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getEcidFromResponse = (function (response) { + var identityResultPayloads = response.getPayloadsByType("identity:result"); + var ecidPayload = find(identityResultPayloads, function (payload) { + return payload.namespace && payload.namespace.code === ecidNamespace; + }); + return ecidPayload ? ecidPayload.id : undefined; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createGetIdentity = (function (_ref) { + var sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest, + createIdentityRequestPayload = _ref.createIdentityRequestPayload, + createIdentityRequest = _ref.createIdentityRequest; + return function (namespaces) { + var payload = createIdentityRequestPayload(namespaces); + var request = createIdentityRequest(payload); + return sendEdgeNetworkRequest({ + request: request + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createAddIdentity = (function (content) { + return function (namespaceCode, identity) { + content.xdm = content.xdm || {}; + content.xdm.identityMap = content.xdm.identityMap || {}; + content.xdm.identityMap[namespaceCode] = content.xdm.identityMap[namespaceCode] || []; + content.xdm.identityMap[namespaceCode].push(identity); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createRequest = (function (options) { + var payload = options.payload, + _getAction = options.getAction, + _getUseSendBeacon = options.getUseSendBeacon; + var id = v4_1(); + var shouldUseThirdPartyDomain = false; + var isIdentityEstablished = false; + return { + getId: function getId() { + return id; + }, + getPayload: function getPayload() { + return payload; + }, + getAction: function getAction() { + return _getAction({ + isIdentityEstablished: isIdentityEstablished + }); + }, + getUseSendBeacon: function getUseSendBeacon() { + return _getUseSendBeacon({ + isIdentityEstablished: isIdentityEstablished + }); + }, + getUseIdThirdPartyDomain: function getUseIdThirdPartyDomain() { + return shouldUseThirdPartyDomain; + }, + setUseIdThirdPartyDomain: function setUseIdThirdPartyDomain() { + shouldUseThirdPartyDomain = true; + }, + setIsIdentityEstablished: function setIsIdentityEstablished() { + isIdentityEstablished = true; + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createDataCollectionRequest = (function (dataCollectionRequestPayload) { + var getUseSendBeacon = function getUseSendBeacon(_ref) { + var isIdentityEstablished = _ref.isIdentityEstablished; + // When the document may be unloading, we still hit the interact endpoint + // using fetch if an identity has not been established. If we were instead + // to hit the collect endpoint using sendBeacon in this case, one of three + // things would occur: + // + // 1. The document ultimately isn't unloaded and Alloy receives an empty + // response back from the collect endpoint, resulting in an error being + // thrown by Alloy because we weren't able to establish an identity. + // This is bad. + // 2. The document is unloaded, but Alloy receives the empty + // response back from the collect endpoint before navigation is completed, + // resulting in an error being thrown by Alloy because we weren't able to + // establish an identity. This is bad. + // 3. The document is unloaded and Alloy does not receive the empty response + // back from the collect endpoint before navigation is completed. No error + // will be thrown, but no identity was established either. This is okay, + // though no identity was established. + // + // By hitting the interact endpoint using fetch, one of the three things + // would occur: + // + // 1. The document ultimately isn't unloaded and Alloy receives a + // response with an identity back from the interact endpoint. No + // error will be thrown and an identity is established. This is good. + // 2. The document is unloaded and Alloy receives a response with an + // identity back from the interact endpoint before navigation is completed. + // No error will be thrown and an identity is established. This is good. + // 3. The document is unloaded and Alloy does not receive the empty response + // back from the collect endpoint before navigation is completed. In this + // case, no error is thrown, but no identity was established and it's + // more likely that the request never makes it to the server because we're + // using fetch instead of sendBeacon. + // + // The second approach seemed preferable. + return dataCollectionRequestPayload.getDocumentMayUnload() && isIdentityEstablished; + }; + + return createRequest({ + payload: dataCollectionRequestPayload, + getAction: function getAction(_ref2) { + var isIdentityEstablished = _ref2.isIdentityEstablished; + return getUseSendBeacon({ + isIdentityEstablished: isIdentityEstablished + }) ? "collect" : "interact"; + }, + getUseSendBeacon: getUseSendBeacon + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // request payloads share. + + var createRequestPayload = (function (options) { + var content = options.content, + addIdentity = options.addIdentity; + return { + mergeState: createMerger(content, "meta.state"), + mergeQuery: createMerger(content, "query"), + addIdentity: addIdentity, + toJSON: function toJSON() { + return content; + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createDataCollectionRequestPayload = (function () { + var content = {}; + var payload = createRequestPayload({ + content: content, + addIdentity: createAddIdentity(content) + }); + + payload.addEvent = function (event) { + content.events = content.events || []; + content.events.push(event); + }; + + payload.getDocumentMayUnload = function () { + return (content.events || []).some(function (event) { + return event.getDocumentMayUnload(); + }); + }; + + return payload; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createIdentityRequest = (function (identityRequestPayload) { + return createRequest({ + payload: identityRequestPayload, + getAction: function getAction() { + return "identity/acquire"; + }, + getUseSendBeacon: function getUseSendBeacon() { + return false; + } + }); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createIdentityRequestPayload = (function (namespaces) { + var content = { + query: { + identity: { + fetch: namespaces + } + } + }; + return createRequestPayload({ + content: content, + addIdentity: createAddIdentity(content) + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createIdentity = function createIdentity(_ref) { + var config = _ref.config, + logger = _ref.logger, + consent = _ref.consent, + fireReferrerHideableImage = _ref.fireReferrerHideableImage, + sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest; + var orgId = config.orgId, + thirdPartyCookiesEnabled = config.thirdPartyCookiesEnabled; + var getEcidFromVisitor = injectGetEcidFromVisitor({ + logger: logger, + orgId: orgId, + awaitVisitorOptIn: awaitVisitorOptIn + }); + var legacyIdentity = createLegacyIdentity({ + config: config, + getEcidFromVisitor: getEcidFromVisitor + }); + var doesIdentityCookieExist = injectDoesIdentityCookieExist({ + orgId: orgId + }); + var getIdentity = createGetIdentity({ + sendEdgeNetworkRequest: sendEdgeNetworkRequest, + createIdentityRequestPayload: createIdentityRequestPayload, + createIdentityRequest: createIdentityRequest + }); + var setDomainForInitialIdentityPayload = injectSetDomainForInitialIdentityPayload({ + thirdPartyCookiesEnabled: thirdPartyCookiesEnabled, + areThirdPartyCookiesSupportedByDefault: areThirdPartyCookiesSupportedByDefault + }); + var addLegacyEcidToPayload = injectAddLegacyEcidToPayload({ + getLegacyEcid: legacyIdentity.getEcid, + addEcidToPayload: addEcidToPayload + }); + var awaitIdentityCookie = injectAwaitIdentityCookie({ + doesIdentityCookieExist: doesIdentityCookieExist, + orgId: orgId + }); + var ensureSingleIdentity = injectEnsureSingleIdentity({ + doesIdentityCookieExist: doesIdentityCookieExist, + setDomainForInitialIdentityPayload: setDomainForInitialIdentityPayload, + addLegacyEcidToPayload: addLegacyEcidToPayload, + awaitIdentityCookie: awaitIdentityCookie, + logger: logger + }); + var processIdSyncs = injectProcessIdSyncs({ + fireReferrerHideableImage: fireReferrerHideableImage, + logger: logger + }); + var handleResponseForIdSyncs = injectHandleResponseForIdSyncs({ + processIdSyncs: processIdSyncs + }); + return createComponent$4({ + ensureSingleIdentity: ensureSingleIdentity, + addEcidQueryToPayload: addEcidQueryToPayload, + setLegacyEcid: legacyIdentity.setEcid, + handleResponseForIdSyncs: handleResponseForIdSyncs, + getEcidFromResponse: getEcidFromResponse, + getIdentity: getIdentity, + consent: consent + }); + }; + + createIdentity.namespace = "Identity"; + createIdentity.configValidators = configValidators; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createResultLogMessage = function createResultLogMessage(urlDestination, success) { + return "URL destination " + (success ? "succeeded" : "failed") + ": " + urlDestination.spec.url; + }; + + var processUrls = function processUrls(fireReferrerHideableImage, logger, destinations) { + var urlDestinations = destinations.filter(function (dest) { + return dest.type === "url"; + }); + return Promise.all(urlDestinations.map(function (urlDestination) { + return fireReferrerHideableImage(urlDestination.spec).then(function () { + logger.info(createResultLogMessage(urlDestination, true)); + }).catch(function () { + // We intentionally do not throw an error if destinations fail. We + // consider it a non-critical failure and therefore do not want it to + // reject the promise handed back to the customer. + logger.error(createResultLogMessage(urlDestination, false)); + }); + })).then(noop$1); + }; + + var processCookies = function processCookies(destinations) { + var cookieDestinations = destinations.filter(function (dest) { + return dest.type === "cookie"; + }); + cookieDestinations.forEach(function (dest) { + var _dest$spec = dest.spec, + name = _dest$spec.name, + value = _dest$spec.value, + domain = _dest$spec.domain, + ttlDays = _dest$spec.ttlDays; + reactorCookie.set(name, value || "", { + domain: domain || "", + expires: ttlDays || 10 // days + + }); + }); + }; + + var injectProcessDestinations = (function (_ref) { + var fireReferrerHideableImage = _ref.fireReferrerHideableImage, + logger = _ref.logger; + return function (destinations) { + processCookies(destinations); + return processUrls(fireReferrerHideableImage, logger, destinations); + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectProcessResponse = (function (_ref) { + var processDestinations = _ref.processDestinations; + + var processPushDestinations = function processPushDestinations(_ref2) { + var response = _ref2.response; + var destinations = response.getPayloadsByType("activation:push"); + return processDestinations(destinations); + }; + + var retrievePullDestinations = function retrievePullDestinations(_ref3) { + var response = _ref3.response; + return { + destinations: response.getPayloadsByType("activation:pull") + }; + }; + + return function (_ref4) { + var response = _ref4.response; + return processPushDestinations({ + response: response + }).then(function () { + return retrievePullDestinations({ + response: response + }); + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createAudiences = function createAudiences(_ref) { + var logger = _ref.logger, + fireReferrerHideableImage = _ref.fireReferrerHideableImage; + var processDestinations = injectProcessDestinations({ + fireReferrerHideableImage: fireReferrerHideableImage, + logger: logger + }); + var processResponse = injectProcessResponse({ + processDestinations: processDestinations + }); + return { + lifecycle: { + onResponse: processResponse + }, + commands: {} + }; + }; + + createAudiences.namespace = "Audiences"; + createAudiences.configValidators = {}; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var PAGE_WIDE_SCOPE = "__view__"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DEFAULT_CONTENT_ITEM = "https://ns.adobe.com/personalization/default-content-item"; + var DOM_ACTION = "https://ns.adobe.com/personalization/dom-action"; + var HTML_CONTENT_ITEM = "https://ns.adobe.com/personalization/html-content-item"; + var JSON_CONTENT_ITEM = "https://ns.adobe.com/personalization/json-content-item"; + var REDIRECT_ITEM = "https://ns.adobe.com/personalization/redirect-item"; + var MEASUREMENT_SCHEMA = "https://ns.adobe.com/personalization/measurement"; + + var createPersonalizationDetails = (function (_ref) { + var renderDecisions = _ref.renderDecisions, + decisionScopes = _ref.decisionScopes, + event = _ref.event, + viewCache = _ref.viewCache; + var viewName = event.getViewName(); + return { + isRenderDecisions: function isRenderDecisions() { + return renderDecisions; + }, + getViewName: function getViewName() { + return viewName; + }, + hasScopes: function hasScopes() { + return decisionScopes.length > 0; + }, + hasViewName: function hasViewName() { + return isNonEmptyString(viewName); + }, + createQueryDetails: function createQueryDetails() { + var scopes = _toConsumableArray(decisionScopes); + + if (!this.isCacheInitialized() && !includes(scopes, PAGE_WIDE_SCOPE)) { + scopes.push(PAGE_WIDE_SCOPE); + } + + var schemas = [DEFAULT_CONTENT_ITEM, HTML_CONTENT_ITEM, JSON_CONTENT_ITEM, REDIRECT_ITEM]; + + if (includes(scopes, PAGE_WIDE_SCOPE)) { + schemas.push(DOM_ACTION); + } + + return { + schemas: schemas, + decisionScopes: scopes + }; + }, + isCacheInitialized: function isCacheInitialized() { + return viewCache.isInitialized(); + }, + shouldFetchData: function shouldFetchData() { + return this.hasScopes() || !this.isCacheInitialized(); + }, + shouldUseCachedData: function shouldUseCachedData() { + return this.hasViewName() && this.isCacheInitialized(); + } + }; + }); + + var AUTHORING_ENABLED = "Rendering is disabled for authoring mode."; + var REDIRECT_EXECUTION_ERROR = "An error occurred while executing the redirect offer."; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createComponent$3 = (function (_ref) { + var logger = _ref.logger, + fetchDataHandler = _ref.fetchDataHandler, + viewChangeHandler = _ref.viewChangeHandler, + onClickHandler = _ref.onClickHandler, + isAuthoringModeEnabled = _ref.isAuthoringModeEnabled, + mergeQuery = _ref.mergeQuery, + viewCache = _ref.viewCache, + showContainers = _ref.showContainers; + return { + lifecycle: { + onBeforeEvent: function onBeforeEvent(_ref2) { + var event = _ref2.event, + renderDecisions = _ref2.renderDecisions, + _ref2$decisionScopes = _ref2.decisionScopes, + decisionScopes = _ref2$decisionScopes === void 0 ? [] : _ref2$decisionScopes, + _ref2$onResponse = _ref2.onResponse, + onResponse = _ref2$onResponse === void 0 ? noop$1 : _ref2$onResponse, + _ref2$onRequestFailur = _ref2.onRequestFailure, + onRequestFailure = _ref2$onRequestFailur === void 0 ? noop$1 : _ref2$onRequestFailur; + // Include propositions on all responses, overridden with data as needed + onResponse(function () { + return { + propositions: [] + }; + }); + onRequestFailure(function () { + return showContainers(); + }); + + if (isAuthoringModeEnabled()) { + logger.warn(AUTHORING_ENABLED); // If we are in authoring mode we disable personalization + + mergeQuery(event, { + enabled: false + }); + return; + } + + var personalizationDetails = createPersonalizationDetails({ + renderDecisions: renderDecisions, + decisionScopes: decisionScopes, + event: event, + viewCache: viewCache + }); + + if (personalizationDetails.shouldFetchData()) { + var decisionsDeferred = defer(); + viewCache.storeViews(decisionsDeferred.promise); + onRequestFailure(function () { + return decisionsDeferred.reject(); + }); + fetchDataHandler({ + decisionsDeferred: decisionsDeferred, + personalizationDetails: personalizationDetails, + event: event, + onResponse: onResponse + }); + return; + } + + if (personalizationDetails.shouldUseCachedData()) { + // eslint-disable-next-line consistent-return + return viewChangeHandler({ + personalizationDetails: personalizationDetails, + event: event, + onResponse: onResponse, + onRequestFailure: onRequestFailure + }); + } + }, + onClick: function onClick(_ref3) { + var event = _ref3.event, + clickedElement = _ref3.clickedElement; + onClickHandler({ + event: event, + clickedElement: clickedElement + }); + } + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createFragment = (function (content) { + return createNode(DIV, {}, { + innerHTML: content + }); + }); + + var css_escape = createCommonjsModule(function (module, exports) { + + (function (root, factory) { + // https://github.com/umdjs/umd/blob/master/returnExports.js + { + // For Node.js. + module.exports = factory(root); + } + })(typeof commonjsGlobal != 'undefined' ? commonjsGlobal : commonjsGlobal, function (root) { + if (root.CSS && root.CSS.escape) { + return root.CSS.escape; + } // https://drafts.csswg.org/cssom/#serialize-an-identifier + + + var cssEscape = function cssEscape(value) { + if (arguments.length == 0) { + throw new TypeError('`CSS.escape` requires an argument.'); + } + + var string = String(value); + var length = string.length; + var index = -1; + var codeUnit; + var result = ''; + var firstCodeUnit = string.charCodeAt(0); + + while (++index < length) { + codeUnit = string.charCodeAt(index); // Note: there’s no need to special-case astral symbols, surrogate + // pairs, or lone surrogates. + // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER + // (U+FFFD). + + if (codeUnit == 0x0000) { + result += "\uFFFD"; + continue; + } + + if ( // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is + // U+007F, […] + codeUnit >= 0x0001 && codeUnit <= 0x001F || codeUnit == 0x007F || // If the character is the first character and is in the range [0-9] + // (U+0030 to U+0039), […] + index == 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039 || // If the character is the second character and is in the range [0-9] + // (U+0030 to U+0039) and the first character is a `-` (U+002D), […] + index == 1 && codeUnit >= 0x0030 && codeUnit <= 0x0039 && firstCodeUnit == 0x002D) { + // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point + result += '\\' + codeUnit.toString(16) + ' '; + continue; + } + + if ( // If the character is the first character and is a `-` (U+002D), and + // there is no second character, […] + index == 0 && length == 1 && codeUnit == 0x002D) { + result += '\\' + string.charAt(index); + continue; + } // If the character is not handled by one of the above rules and is + // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or + // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to + // U+005A), or [a-z] (U+0061 to U+007A), […] + + + if (codeUnit >= 0x0080 || codeUnit == 0x002D || codeUnit == 0x005F || codeUnit >= 0x0030 && codeUnit <= 0x0039 || codeUnit >= 0x0041 && codeUnit <= 0x005A || codeUnit >= 0x0061 && codeUnit <= 0x007A) { + // the character itself + result += string.charAt(index); + continue; + } // Otherwise, the escaped character. + // https://drafts.csswg.org/cssom/#escape-a-character + + + result += '\\' + string.charAt(index); + } + + return result; + }; + + if (!root.CSS) { + root.CSS = {}; + } + + root.CSS.escape = cssEscape; + return cssEscape; + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var EQ_START = ":eq("; + var EQ_PATTERN = /:eq\((\d+)\)/g; + var isNotEqSelector = function isNotEqSelector(str) { + return str.indexOf(EQ_START) === -1; + }; + var splitWithEq = function splitWithEq(selector) { + return selector.split(EQ_PATTERN).filter(isNonEmptyString); + }; + + var CSS_IDENTIFIER_PATTERN = /(#|\.)(-?\w+)/g; // This is required to remove leading " > " from parsed pieces + + var SIBLING_PATTERN = /^\s*>?\s*/; + + var cleanUp = function cleanUp(str) { + return str.replace(SIBLING_PATTERN, "").trim(); + }; // Here we use CSS.escape() to make sure we get + // correct values for ID and CSS class + // Please check: https://www.w3.org/TR/css-syntax-3/#escaping + // CSS.escape() polyfill can be found here: https://github.com/mathiasbynens/CSS.escape + + + var replaceIdentifier = function replaceIdentifier(_, $1, $2) { + return "" + $1 + css_escape($2); + }; + + var escapeIdentifiersInSelector = function escapeIdentifiersInSelector(selector) { + return selector.replace(CSS_IDENTIFIER_PATTERN, replaceIdentifier); + }; + var parseSelector = function parseSelector(rawSelector) { + var result = []; + var selector = escapeIdentifiersInSelector(rawSelector.trim()); + var parts = splitWithEq(selector); + var length = parts.length; + var i = 0; + + while (i < length) { + var sel = cleanUp(parts[i]); + var eq = parts[i + 1]; + + if (eq) { + result.push({ + sel: sel, + eq: Number(eq) + }); + } else { + result.push({ + sel: sel + }); + } + + i += 2; + } + + return result; + }; + /** + * Returns an array of matched DOM nodes. + * @param {String} selector that contains Sizzle "eq(...)" pseudo selector + * @returns {Array} an array of DOM nodes + */ + + var selectNodesWithEq = function selectNodesWithEq(selector) { + var doc = document; + + if (isNotEqSelector(selector)) { + return selectNodes(selector, doc); + } + + var parts = parseSelector(selector); + var length = parts.length; + var result = []; + var context = doc; + var i = 0; + + while (i < length) { + var _parts$i = parts[i], + sel = _parts$i.sel, + eq = _parts$i.eq; + var nodes = selectNodes(sel, context); + var nodesCount = nodes.length; + + if (nodesCount === 0) { + break; + } + + if (eq != null && eq > nodesCount - 1) { + break; + } + + if (i < length - 1) { + if (eq == null) { + var _nodes = _slicedToArray(nodes, 1); + + context = _nodes[0]; + } else { + context = nodes[eq]; + } + } + + if (i === length - 1) { + if (eq == null) { + result = nodes; + } else { + result = [nodes[eq]]; + } + } + + i += 1; + } + + return result; + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Returns an array of matched DOM nodes. + * @param {String} id + * @param {Node} [context=document] defaults to document + * @returns {HTMLElement} an element of null + */ + var getElementById = (function (id) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; + return context.getElementById(id); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var setAttribute = (function (element, name, value) { + element.setAttribute(name, value); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getAttribute = (function (element, name) { + return element.getAttribute(name); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var removeAttribute = (function (element, name) { + element.removeAttribute(name); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var setStyle = (function (element, name, value, priority) { + var css; + + if (priority) { + css = name + ":" + value + " !" + priority + ";"; + } else { + css = name + ":" + value + ";"; + } + + element.style.cssText += ";" + css; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getParent = (function (element) { + return element.parentNode; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getNextSibling = (function (element) { + return element.nextElementSibling; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var insertAfter = (function (container, element) { + if (!container) { + return; + } + + var parent = getParent(container); + + if (parent) { + parent.insertBefore(element, getNextSibling(container)); + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var insertBefore = (function (container, element) { + if (!container) { + return; + } + + var parent = getParent(container); + + if (parent) { + parent.insertBefore(element, container); + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getChildren = (function (element) { + var children = element.children; + + if (children) { + return toArray(children); + } + + return []; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getChildNodes = (function (element) { + var childNodes = element.childNodes; + + if (childNodes) { + return toArray(childNodes); + } + + return []; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var getFirstChild = (function (element) { + return element.firstElementChild; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var nonce; + /** + * Returns the nonce if available. + * @param {Node} [context=document] defaults to document + * @returns {(String|undefined)} the nonce or undefined if not available + */ + + var getNonce = (function () { + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + + if (nonce === undefined) { + var n = context.querySelector("[nonce]"); // NOTE: We're keeping n.getAttribute("nonce") until it is safe to remove: + // ref: https://github.com/whatwg/html/issues/2369#issuecomment-280853946 + + nonce = n && (n.nonce || n.getAttribute("nonce")); + } + + return nonce; + }); // This function is only used for testing and removed when library is built (tree-shaking) + + var PREHIDING_ID = "alloy-prehiding"; + var HIDING_STYLE_DEFINITION = "{ visibility: hidden }"; // Using global is OK since we have a single DOM + // so storing nodes even for multiple Alloy instances is fine + + var styleNodes = {}; + var hideElements = function hideElements(prehidingSelector) { + // if we have different events with the same + // prehiding selector we don't want to recreate + // the style tag + if (styleNodes[prehidingSelector]) { + return; + } + + var nonce = getNonce(); + + var attrs = _objectSpread2({}, nonce && { + nonce: nonce + }); + + var props = { + textContent: prehidingSelector + " " + HIDING_STYLE_DEFINITION + }; + var node = createNode(STYLE, attrs, props); + appendNode(document.head, node); + styleNodes[prehidingSelector] = node; + }; + var showElements = function showElements(prehidingSelector) { + var node = styleNodes[prehidingSelector]; + + if (node) { + removeNode(node); + delete styleNodes[prehidingSelector]; + } + }; + var hideContainers = function hideContainers(prehidingStyle) { + if (!prehidingStyle) { + return; + } // If containers prehiding style has been added + // by customer's prehiding snippet we don't + // want to add the same node + + + var node = getElementById(PREHIDING_ID); + + if (node) { + return; + } + + var nonce = getNonce(); + + var attrs = _objectSpread2({ + id: PREHIDING_ID + }, nonce && { + nonce: nonce + }); + + var props = { + textContent: prehidingStyle + }; + var styleNode = createNode(STYLE, attrs, props); + appendNode(document.head, styleNode); + }; + var showContainers = function showContainers() { + // If containers prehiding style exists + // we will remove it + var node = getElementById(PREHIDING_ID); + + if (!node) { + return; + } + + removeNode(node); + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var setText = (function (container, text) { + container.textContent = text; + }); + + /* + Copyright 2022 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var SRC = "src"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var isImage = function isImage(element) { + return element.tagName === IMG; + }; + var loadImage = function loadImage(url) { + return createNode(IMG, { + src: url + }); + }; + var loadImages = function loadImages(fragment) { + var images = selectNodes(IMG, fragment); + images.forEach(function (image) { + var url = getAttribute(image, SRC); + + if (url) { + loadImage(url); + } + }); + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var is$1 = function is(element, tagName) { + return element.tagName === tagName; + }; + + var isInlineStyleElement = function isInlineStyleElement(element) { + return is$1(element, STYLE) && !getAttribute(element, SRC); + }; + + var addNonceToInlineStyleElements = (function (fragment) { + var styleNodes = selectNodes(STYLE, fragment); + var length = styleNodes.length; + var nonce = getNonce(); + + if (!nonce) { + return; + } + /* eslint-disable no-continue */ + + + for (var i = 0; i < length; i += 1) { + var element = styleNodes[i]; + + if (!isInlineStyleElement(element)) { + continue; + } + + element.nonce = nonce; + } + }); + + /** + * @this {Promise} + */ + function finallyConstructor(callback) { + var constructor = this.constructor; + return this.then(function (value) { + // @ts-ignore + return constructor.resolve(callback()).then(function () { + return value; + }); + }, function (reason) { + // @ts-ignore + return constructor.resolve(callback()).then(function () { + // @ts-ignore + return constructor.reject(reason); + }); + }); + } + + // other code modifying setTimeout (like sinon.useFakeTimers()) + + var setTimeoutFunc = setTimeout; + + function isArray(x) { + return Boolean(x && typeof x.length !== 'undefined'); + } + + function noop() {} // Polyfill for Function.prototype.bind + + + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + /** + * @constructor + * @param {Function} fn + */ + + + function Promise$1(fn) { + if (!(this instanceof Promise$1)) throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') throw new TypeError('not a function'); + /** @type {!number} */ + + this._state = 0; + /** @type {!boolean} */ + + this._handled = false; + /** @type {Promise|undefined} */ + + this._value = undefined; + /** @type {!Array} */ + + this._deferreds = []; + doResolve(fn, this); + } + + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + + if (self._state === 0) { + self._deferreds.push(deferred); + + return; + } + + self._handled = true; + + Promise$1._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + + var ret; + + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + + resolve(deferred.promise, ret); + }); + } + + function resolve(self, newValue) { + try { + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure + if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); + + if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + + if (newValue instanceof Promise$1) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise$1._immediateFn(function () { + if (!self._handled) { + Promise$1._unhandledRejectionFn(self._value); + } + }); + } + + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + + self._deferreds = null; + } + /** + * @constructor + */ + + + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + /** + * Take a potentially misbehaving resolver function and make sure + * onFulfilled and onRejected are only called once. + * + * Makes no guarantees about asynchrony. + */ + + + function doResolve(fn, self) { + var done = false; + + try { + fn(function (value) { + if (done) return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) return; + done = true; + reject(self, ex); + } + } + + Promise$1.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + Promise$1.prototype.then = function (onFulfilled, onRejected) { + // @ts-ignore + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + + Promise$1.prototype['finally'] = finallyConstructor; + + Promise$1.all = function (arr) { + return new Promise$1(function (resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.all accepts an array')); + } + + var args = Array.prototype.slice.call(arr); + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + try { + if (val && (_typeof(val) === 'object' || typeof val === 'function')) { + var then = val.then; + + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + + args[i] = val; + + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + Promise$1.resolve = function (value) { + if (value && _typeof(value) === 'object' && value.constructor === Promise$1) { + return value; + } + + return new Promise$1(function (resolve) { + resolve(value); + }); + }; + + Promise$1.reject = function (value) { + return new Promise$1(function (resolve, reject) { + reject(value); + }); + }; + + Promise$1.race = function (arr) { + return new Promise$1(function (resolve, reject) { + if (!isArray(arr)) { + return reject(new TypeError('Promise.race accepts an array')); + } + + for (var i = 0, len = arr.length; i < len; i++) { + Promise$1.resolve(arr[i]).then(resolve, reject); + } + }); + }; // Use polyfill for setImmediate for performance gains + + + Promise$1._immediateFn = // @ts-ignore + typeof setImmediate === 'function' && function (fn) { + // @ts-ignore + setImmediate(fn); + } || function (fn) { + setTimeoutFunc(fn, 0); + }; + + Promise$1._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console + } + }; + + // Karma + Webpack. You need to specify the default import when using promise-polyfill` + // with Webpack 2+. We need `require('promise-polyfill').default` for running the tests + // and `require('promise-polyfill')` for building Turbine. + + + var reactorPromise = typeof window !== 'undefined' && window.Promise || typeof commonjsGlobal !== 'undefined' && commonjsGlobal.Promise || Promise$1.default || Promise$1; + + var getPromise = function getPromise(url, script) { + return new reactorPromise(function (resolve, reject) { + script.onload = function () { + resolve(script); + }; + + script.onerror = function () { + reject(new Error('Failed to load script ' + url)); + }; + }); + }; + + var reactorLoadScript = function reactorLoadScript(url) { + var script = document.createElement('script'); + script.src = url; + script.async = true; + var promise = getPromise(url, script); + document.getElementsByTagName('head')[0].appendChild(script); + return promise; + }; + + var is = function is(element, tagName) { + return !!element && element.tagName === tagName; + }; + + var isInlineScript = function isInlineScript(element) { + return is(element, SCRIPT) && !getAttribute(element, SRC); + }; + + var isRemoteScript = function isRemoteScript(element) { + return is(element, SCRIPT) && getAttribute(element, SRC); + }; + + var getInlineScripts = function getInlineScripts(fragment) { + var scripts = selectNodes(SCRIPT, fragment); + var result = []; + var length = scripts.length; + var nonce = getNonce(); + + var attributes = _objectSpread2({}, nonce && { + nonce: nonce + }); + /* eslint-disable no-continue */ + + + for (var i = 0; i < length; i += 1) { + var element = scripts[i]; + + if (!isInlineScript(element)) { + continue; + } + + var textContent = element.textContent; + + if (!textContent) { + continue; + } + + result.push(createNode(SCRIPT, attributes, { + textContent: textContent + })); + } + /* eslint-enable no-continue */ + + + return result; + }; + var getRemoteScriptsUrls = function getRemoteScriptsUrls(fragment) { + var scripts = selectNodes(SCRIPT, fragment); + var result = []; + var length = scripts.length; + /* eslint-disable no-continue */ + + for (var i = 0; i < length; i += 1) { + var element = scripts[i]; + + if (!isRemoteScript(element)) { + continue; + } + + var url = getAttribute(element, SRC); + + if (!url) { + continue; + } + + result.push(url); + } + /* eslint-enable no-continue */ + + + return result; + }; + var executeInlineScripts = function executeInlineScripts(parent, scripts) { + scripts.forEach(function (script) { + parent.appendChild(script); + parent.removeChild(script); + }); + }; + var executeRemoteScripts = function executeRemoteScripts(urls) { + return Promise.all(urls.map(reactorLoadScript)); + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var appendHtml = (function (container, html) { + var fragment = createFragment(html); + addNonceToInlineStyleElements(fragment); + var elements = getChildNodes(fragment); + var scripts = getInlineScripts(fragment); + var scriptsUrls = getRemoteScriptsUrls(fragment); + loadImages(fragment); + elements.forEach(function (element) { + appendNode(container, element); + }); + executeInlineScripts(container, scripts); + return executeRemoteScripts(scriptsUrls); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var clear = function clear(container) { + // We want to remove ALL nodes, text, comments etc + var childNodes = getChildNodes(container); + childNodes.forEach(removeNode); + }; + + var setHtml = (function (container, html) { + clear(container); + appendHtml(container, html); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var prependHtml = (function (container, html) { + var fragment = createFragment(html); + addNonceToInlineStyleElements(fragment); + var elements = getChildNodes(fragment); + var scripts = getInlineScripts(fragment); + var scriptsUrls = getRemoteScriptsUrls(fragment); + var length = elements.length; + var i = length - 1; // We have to proactively load images to avoid flicker + + loadImages(fragment); // We are inserting elements in reverse order + + while (i >= 0) { + var element = elements[i]; + var firstChild = getFirstChild(container); + + if (firstChild) { + insertBefore(firstChild, element); + } else { + appendNode(container, element); + } + + i -= 1; + } + + executeInlineScripts(container, scripts); + return executeRemoteScripts(scriptsUrls); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var insertHtmlBefore = (function (container, html) { + var fragment = createFragment(html); + addNonceToInlineStyleElements(fragment); + var elements = getChildNodes(fragment); + var scripts = getInlineScripts(fragment); + var scriptsUrls = getRemoteScriptsUrls(fragment); + loadImages(fragment); + elements.forEach(function (element) { + insertBefore(container, element); + }); + executeInlineScripts(container, scripts); + return executeRemoteScripts(scriptsUrls); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var replaceHtml = (function (container, html) { + insertHtmlBefore(container, html); + removeNode(container); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var insertHtmlAfter = (function (container, html) { + var fragment = createFragment(html); + addNonceToInlineStyleElements(fragment); + var elements = getChildNodes(fragment); + var scripts = getInlineScripts(fragment); + var scriptsUrls = getRemoteScriptsUrls(fragment); + loadImages(fragment); + elements.forEach(function (element) { + insertAfter(container, element); + }); + executeInlineScripts(container, scripts); + return executeRemoteScripts(scriptsUrls); + }); + + var _excluded$1 = ["priority"]; + var setStyles = (function (container, styles) { + var priority = styles.priority, + style = _objectWithoutProperties(styles, _excluded$1); + + Object.keys(style).forEach(function (key) { + setStyle(container, key, style[key], priority); + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var setAttributes = (function (container, attributes) { + Object.keys(attributes).forEach(function (key) { + setAttribute(container, key, attributes[key]); + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var swapImage = (function (container, url) { + if (!isImage(container)) { + return; + } // Start downloading the image + + + loadImage(url); // Remove "src" so there is no flicker + + removeAttribute(container, SRC); // Replace the image "src" + + setAttribute(container, SRC, url); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var rearrangeChildren = (function (container, _ref) { + var from = _ref.from, + to = _ref.to; + var children = getChildren(container); + var elementFrom = children[from]; + var elementTo = children[to]; + + if (!elementFrom || !elementTo) { + // TODO: We will need to add logging + // to ease troubleshooting + return; + } + + if (from < to) { + insertAfter(elementTo, elementFrom); + } else { + insertBefore(elementTo, elementFrom); + } + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var _click = (function (settings, store) { + var selector = settings.selector, + meta = settings.meta; + store({ + selector: selector, + meta: meta + }); + return Promise.resolve(); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var renderContent = function renderContent(elements, content, renderFunc) { + var executions = elements.map(function (element) { + return renderFunc(element, content); + }); + return Promise.all(executions); + }; + + var createAction = function createAction(renderFunc) { + return function (settings) { + var selector = settings.selector, + prehidingSelector = settings.prehidingSelector, + content = settings.content, + meta = settings.meta; + hideElements(prehidingSelector); + return awaitSelector(selector, selectNodesWithEq).then(function (elements) { + return renderContent(elements, content, renderFunc); + }).then(function () { + // if everything is OK, show elements + showElements(prehidingSelector); + return { + meta: meta + }; + }, function (error) { + // in case of awaiting timing or error, we need to remove the style tag + // hence showing the pre-hidden elements + showElements(prehidingSelector); + return { + meta: meta, + error: error + }; + }); + }; + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var initDomActionsModules = (function (store) { + return { + setHtml: createAction(setHtml), + customCode: createAction(prependHtml), + setText: createAction(setText), + setAttribute: createAction(setAttributes), + setImageSource: createAction(swapImage), + setStyle: createAction(setStyles), + move: createAction(setStyles), + resize: createAction(setStyles), + rearrange: createAction(rearrangeChildren), + remove: createAction(removeNode), + insertAfter: createAction(insertHtmlAfter), + insertBefore: createAction(insertHtmlBefore), + replaceHtml: createAction(replaceHtml), + prependHtml: createAction(prependHtml), + appendHtml: createAction(appendHtml), + click: function click(settings) { + return _click(settings, store); + }, + defaultContent: function defaultContent(settings) { + return Promise.resolve({ + meta: settings.meta + }); + } + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + /** + * Returns whether a string value is blank. Also returns true if the value is not a string. + * @param {*} value + * @returns {boolean} + */ + + var isBlankString = (function (value) { + return isString(value) ? !value.trim() : true; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var APPEND_HTML = "appendHtml"; + var HEAD_TAGS_SELECTOR = "SCRIPT,LINK,STYLE"; + + var filterHeadContent = function filterHeadContent(content) { + var container = createFragment(content); + var headNodes = selectNodes(HEAD_TAGS_SELECTOR, container); + return headNodes.map(function (node) { + return node.outerHTML; + }).join(""); + }; + + var preprocess = (function (action) { + var result = reactorObjectAssign({}, action); + var content = result.content, + selector = result.selector; + + if (isBlankString(content)) { + return result; + } + + var container = selectNodesWithEq(selector); + + if (!is(container[0], HEAD)) { + return result; + } + + result.type = APPEND_HTML; + result.content = filterHeadContent(content); + return result; + }); + + var logActionError = function logActionError(logger, action, error) { + if (logger.enabled) { + var details = JSON.stringify(action); + var message = error.message, + stack = error.stack; + var errorMessage = "Failed to execute action " + details + ". " + message + " " + (stack ? "\n " + stack : ""); + logger.error(errorMessage); + } + }; + + var logActionCompleted = function logActionCompleted(logger, action) { + if (logger.enabled) { + var details = JSON.stringify(action); + logger.info("Action " + details + " executed."); + } + }; + + var executeAction = function executeAction(logger, modules, type, args) { + var execute = modules[type]; + + if (!execute) { + var error = new Error("DOM action \"" + type + "\" not found"); + logActionError(logger, args[0], error); + throw error; + } + + return execute.apply(void 0, _toConsumableArray(args)); + }; + + var executeActions = (function (actions, modules, logger) { + var actionPromises = actions.map(function (action) { + var processedAction = preprocess(action); + var type = processedAction.type; + return executeAction(logger, modules, type, [processedAction]).then(function (result) { + logActionCompleted(logger, processedAction); + return result; + }).catch(function (error) { + logActionError(logger, processedAction, error); + throw error; + }); + }); + return Promise.all(actionPromises); + }); + + /* + Copyright 2022 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DISPLAY = "decisioning.propositionDisplay"; + var INTERACT = "decisioning.propositionInteract"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createCollect = (function (_ref) { + var eventManager = _ref.eventManager, + mergeDecisionsMeta = _ref.mergeDecisionsMeta; + // Called when a decision is auto-rendered for the __view__ scope or a SPA view(display and empty display notification) + return function (_ref2) { + var _ref2$decisionsMeta = _ref2.decisionsMeta, + decisionsMeta = _ref2$decisionsMeta === void 0 ? [] : _ref2$decisionsMeta, + _ref2$documentMayUnlo = _ref2.documentMayUnload, + documentMayUnload = _ref2$documentMayUnlo === void 0 ? false : _ref2$documentMayUnlo, + viewName = _ref2.viewName; + var event = eventManager.createEvent(); + var data = { + eventType: DISPLAY + }; + + if (viewName) { + data.web = { + webPageDetails: { + viewName: viewName + } + }; + } + + if (isNonEmptyArray(decisionsMeta)) { + mergeDecisionsMeta(event, decisionsMeta); + } + + event.mergeXdm(data); + + if (documentMayUnload) { + event.documentMayUnload(); + } + + return eventManager.sendEvent(event); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DEFAULT_ACTION_TYPE = "defaultContent"; + + var identity = function identity(item) { + return item; + }; + + var buildActions = function buildActions(decision) { + var meta = { + id: decision.id, + scope: decision.scope, + scopeDetails: decision.scopeDetails + }; + return decision.items.map(function (item) { + return reactorObjectAssign({ + type: DEFAULT_ACTION_TYPE + }, item.data, { + meta: meta + }); + }); + }; + + var processMetas = function processMetas(logger, actionResults) { + var results = flatMap(actionResults, identity); + var finalMetas = []; + var set = new Set(); + results.forEach(function (item) { + // for click actions we don't return an item + if (!item) { + return; + } + + if (item.error) { + logger.warn(item); + return; + } + + var meta = item.meta; + + if (set.has(meta.id)) { + return; + } + + set.add(meta.id); + finalMetas.push(meta); + }); + return finalMetas; + }; + + var createExecuteDecisions = (function (_ref) { + var modules = _ref.modules, + logger = _ref.logger, + executeActions = _ref.executeActions; + return function (decisions) { + var actionResultsPromises = decisions.map(function (decision) { + var actions = buildActions(decision); + return executeActions(actions, modules, logger); + }); + return Promise.all(actionResultsPromises).then(function (results) { + return processMetas(logger, results); + }).catch(function (error) { + logger.error(error); + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createFetchDataHandler = (function (_ref) { + var config = _ref.config, + responseHandler = _ref.responseHandler, + hideContainers = _ref.hideContainers, + mergeQuery = _ref.mergeQuery; + return function (_ref2) { + var decisionsDeferred = _ref2.decisionsDeferred, + personalizationDetails = _ref2.personalizationDetails, + event = _ref2.event, + onResponse = _ref2.onResponse; + var prehidingStyle = config.prehidingStyle; + + if (personalizationDetails.isRenderDecisions()) { + hideContainers(prehidingStyle); + } + + mergeQuery(event, personalizationDetails.createQueryDetails()); + onResponse(function (_ref3) { + var response = _ref3.response; + return responseHandler({ + decisionsDeferred: decisionsDeferred, + personalizationDetails: personalizationDetails, + response: response + }); + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var matchesSelectorWithEq = (function (selector, element) { + if (isNotEqSelector(selector)) { + return matchesSelector(selector, element); + } // Using node selection vs matches selector, because of :eq() + // Find all nodes using document as context + + + var nodes = selectNodesWithEq(selector); + var result = false; // Iterate through all the identified elements + // and reference compare with element + + for (var i = 0; i < nodes.length; i += 1) { + if (nodes[i] === element) { + result = true; + break; + } + } + + return result; + }); + + var getMetasIfMatches = function getMetasIfMatches(clickedElement, selector, getClickMetasBySelector) { + var _document = document, + documentElement = _document.documentElement; + var element = clickedElement; + + while (element && element !== documentElement) { + if (matchesSelectorWithEq(selector, element)) { + return getClickMetasBySelector(selector); + } + + element = element.parentNode; + } + + return null; + }; + + var collectClicks = (function (clickedElement, selectors, getClickMetasBySelector) { + var result = []; + + for (var i = 0; i < selectors.length; i += 1) { + var metas = getMetasIfMatches(clickedElement, selectors[i], getClickMetasBySelector); + + if (metas) { + result.push.apply(result, _toConsumableArray(metas)); + } + } + + return result; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var isAuthoringModeEnabled = (function () { + var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + return doc.location.href.indexOf("adobe_authoring_enabled") !== -1; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var mergeDecisionsMeta = function mergeDecisionsMeta(event, decisionsMeta) { + event.mergeXdm({ + _experience: { + decisioning: { + propositions: decisionsMeta + } + } + }); + }; + var mergeQuery = function mergeQuery(event, details) { + event.mergeQuery({ + personalization: _objectSpread2({}, details) + }); + }; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createOnClickHandler = (function (_ref) { + var mergeDecisionsMeta = _ref.mergeDecisionsMeta, + collectClicks = _ref.collectClicks, + getClickSelectors = _ref.getClickSelectors, + getClickMetasBySelector = _ref.getClickMetasBySelector; + // Called when an element qualifying for conversion within an offer is clicked. + return function (_ref2) { + var event = _ref2.event, + clickedElement = _ref2.clickedElement; + var selectors = getClickSelectors(); + + if (isNonEmptyArray(selectors)) { + var decisionsMeta = collectClicks(clickedElement, selectors, getClickMetasBySelector); + + if (isNonEmptyArray(decisionsMeta)) { + var xdm = { + eventType: INTERACT + }; + var scope = decisionsMeta[0].scope; + + if (scope !== PAGE_WIDE_SCOPE) { + xdm.web = { + webPageDetails: { + viewName: scope + } + }; + } + + event.mergeXdm(xdm); + mergeDecisionsMeta(event, decisionsMeta); + } + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createViewCacheManager = (function () { + var viewStorage; + var viewStorageDeferred = defer(); + + var storeViews = function storeViews(decisionsPromise) { + decisionsPromise.then(function (decisions) { + if (viewStorage === undefined) { + viewStorage = {}; + } + + reactorObjectAssign(viewStorage, decisions); + viewStorageDeferred.resolve(); + }).catch(function () { + if (viewStorage === undefined) { + viewStorage = {}; + } + + viewStorageDeferred.resolve(); + }); + }; + + var getView = function getView(viewName) { + return viewStorageDeferred.promise.then(function () { + return viewStorage[viewName] || []; + }); + }; + + var isInitialized = function isInitialized() { + return !(viewStorage === undefined); + }; + + return { + storeViews: storeViews, + getView: getView, + isInitialized: isInitialized + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var addRenderAttemptedToDecisions = (function (_ref) { + var decisions = _ref.decisions, + renderAttempted = _ref.renderAttempted; + return decisions.map(function (decision) { + return reactorObjectAssign({ + renderAttempted: renderAttempted + }, decision); + }); + }); + + var composePersonalizationResultingObject = (function () { + var decisions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var renderDecisions = arguments.length > 1 ? arguments[1] : undefined; + var resultingObject = { + propositions: addRenderAttemptedToDecisions({ + decisions: decisions, + renderAttempted: renderDecisions + }) + }; + + if (!renderDecisions) { + resultingObject.decisions = decisions; + } + + return resultingObject; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createViewChangeHandler = (function (_ref) { + var mergeDecisionsMeta = _ref.mergeDecisionsMeta, + collect = _ref.collect, + executeDecisions = _ref.executeDecisions, + viewCache = _ref.viewCache; + return function (_ref2) { + var personalizationDetails = _ref2.personalizationDetails, + event = _ref2.event, + onResponse = _ref2.onResponse; + var viewName = personalizationDetails.getViewName(); + return viewCache.getView(viewName).then(function (viewDecisions) { + if (personalizationDetails.isRenderDecisions()) { + return executeDecisions(viewDecisions).then(function (decisionsMeta) { + // if there are decisions to be rendered we render them and attach the result in experience.decisions.propositions + if (isNonEmptyArray(decisionsMeta)) { + mergeDecisionsMeta(event, decisionsMeta); + onResponse(function () { + return composePersonalizationResultingObject(viewDecisions, true); + }); + return; + } // if there are no decisions in cache for this view, we will send a empty notification + + + onResponse(function () { + collect({ + decisionsMeta: [], + viewName: viewName + }); + return composePersonalizationResultingObject(viewDecisions, true); + }); + }); + } + + onResponse(function () { + return composePersonalizationResultingObject(viewDecisions, false); + }); + return {}; + }); + }; + }); + + /* + Copyright 2022 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var VIEW_SCOPE_TYPE = "view"; + + var splitItems = function splitItems(items, schemas) { + var matched = []; + var nonMatched = []; + items.forEach(function (item) { + if (includes(schemas, item.schema)) { + matched.push(item); + } else { + nonMatched.push(item); + } + }); + return [matched, nonMatched]; + }; + + var createDecision = function createDecision(decision, items) { + return { + id: decision.id, + scope: decision.scope, + items: items, + scopeDetails: decision.scopeDetails + }; + }; + + var splitMergedMetricDecisions = function splitMergedMetricDecisions(decisions) { + var matchedDecisions = decisions.filter(function (decision) { + var _decision$items = decision.items, + items = _decision$items === void 0 ? [] : _decision$items; + return items.some(function (item) { + return item.schema === MEASUREMENT_SCHEMA; + }); + }); + var unmatchedDecisions = decisions.filter(function (decision) { + return !includes(matchedDecisions, decision); + }); + return { + matchedDecisions: matchedDecisions, + unmatchedDecisions: unmatchedDecisions + }; + }; + + var splitDecisions = function splitDecisions(decisions) { + for (var _len = arguments.length, schemas = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + schemas[_key - 1] = arguments[_key]; + } + + var matchedDecisions = []; + var unmatchedDecisions = []; + decisions.forEach(function (decision) { + var _decision$items2 = decision.items, + items = _decision$items2 === void 0 ? [] : _decision$items2; + + var _splitItems = splitItems(items, schemas), + _splitItems2 = _slicedToArray(_splitItems, 2), + matchedItems = _splitItems2[0], + nonMatchedItems = _splitItems2[1]; + + if (isNonEmptyArray(matchedItems)) { + matchedDecisions.push(createDecision(decision, matchedItems)); + } + + if (isNonEmptyArray(nonMatchedItems)) { + unmatchedDecisions.push(createDecision(decision, nonMatchedItems)); + } + }); + return { + matchedDecisions: matchedDecisions, + unmatchedDecisions: unmatchedDecisions + }; + }; + + var appendScopeDecision = function appendScopeDecision(scopeDecisions, decision) { + if (!scopeDecisions[decision.scope]) { + scopeDecisions[decision.scope] = []; + } + + scopeDecisions[decision.scope].push(decision); + }; + + var isViewScope = function isViewScope(scopeDetails) { + return scopeDetails.characteristics && scopeDetails.characteristics.scopeType && scopeDetails.characteristics.scopeType === VIEW_SCOPE_TYPE; + }; + + var extractDecisionsByScope = function extractDecisionsByScope(decisions) { + var pageWideScopeDecisions = []; + var nonPageWideScopeDecisions = []; + var viewScopeDecisions = {}; + + if (isNonEmptyArray(decisions)) { + decisions.forEach(function (decision) { + if (decision.scope === PAGE_WIDE_SCOPE) { + pageWideScopeDecisions.push(decision); + } else if (isViewScope(decision.scopeDetails)) { + appendScopeDecision(viewScopeDecisions, decision); + } else { + nonPageWideScopeDecisions.push(decision); + } + }); + } + + return { + pageWideScopeDecisions: pageWideScopeDecisions, + nonPageWideScopeDecisions: nonPageWideScopeDecisions, + viewScopeDecisions: viewScopeDecisions + }; + }; + + var groupDecisions = function groupDecisions(unprocessedDecisions) { + // split redirect decisions + var decisionsGroupedByRedirectItemSchema = splitDecisions(unprocessedDecisions, REDIRECT_ITEM); // split merged measurement decisions + + var mergedMetricDecisions = splitMergedMetricDecisions(decisionsGroupedByRedirectItemSchema.unmatchedDecisions); // split renderable decisions + + var decisionsGroupedByRenderableSchemas = splitDecisions(mergedMetricDecisions.unmatchedDecisions, DOM_ACTION, DEFAULT_CONTENT_ITEM); // group renderable decisions by scope + + var _extractDecisionsBySc = extractDecisionsByScope(decisionsGroupedByRenderableSchemas.matchedDecisions), + pageWideScopeDecisions = _extractDecisionsBySc.pageWideScopeDecisions, + nonPageWideScopeDecisions = _extractDecisionsBySc.nonPageWideScopeDecisions, + viewScopeDecisions = _extractDecisionsBySc.viewScopeDecisions; + + return { + redirectDecisions: decisionsGroupedByRedirectItemSchema.matchedDecisions, + pageWideScopeDecisions: pageWideScopeDecisions, + viewDecisions: viewScopeDecisions, + nonAutoRenderableDecisions: [].concat(_toConsumableArray(mergedMetricDecisions.matchedDecisions), _toConsumableArray(decisionsGroupedByRenderableSchemas.unmatchedDecisions), _toConsumableArray(nonPageWideScopeDecisions)) + }; + }; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var DECISIONS_HANDLE = "personalization:decisions"; + var createOnResponseHandler = (function (_ref) { + var autoRenderingHandler = _ref.autoRenderingHandler, + nonRenderingHandler = _ref.nonRenderingHandler, + groupDecisions = _ref.groupDecisions, + handleRedirectDecisions = _ref.handleRedirectDecisions, + showContainers = _ref.showContainers; + return function (_ref2) { + var decisionsDeferred = _ref2.decisionsDeferred, + personalizationDetails = _ref2.personalizationDetails, + response = _ref2.response; + var unprocessedDecisions = response.getPayloadsByType(DECISIONS_HANDLE); + var viewName = personalizationDetails.getViewName(); // if personalization payload is empty return empty decisions array + + if (unprocessedDecisions.length === 0) { + showContainers(); + decisionsDeferred.resolve({}); + return { + decisions: [], + propositions: [] + }; + } + + var _groupDecisions = groupDecisions(unprocessedDecisions), + redirectDecisions = _groupDecisions.redirectDecisions, + pageWideScopeDecisions = _groupDecisions.pageWideScopeDecisions, + viewDecisions = _groupDecisions.viewDecisions, + nonAutoRenderableDecisions = _groupDecisions.nonAutoRenderableDecisions; + + if (personalizationDetails.isRenderDecisions() && isNonEmptyArray(redirectDecisions)) { + decisionsDeferred.resolve({}); + return handleRedirectDecisions(redirectDecisions); + } // save decisions for views in local cache + + + decisionsDeferred.resolve(viewDecisions); + + if (personalizationDetails.isRenderDecisions()) { + return autoRenderingHandler({ + viewName: viewName, + pageWideScopeDecisions: pageWideScopeDecisions, + nonAutoRenderableDecisions: nonAutoRenderableDecisions + }); + } + + return nonRenderingHandler({ + viewName: viewName, + redirectDecisions: redirectDecisions, + pageWideScopeDecisions: pageWideScopeDecisions, + nonAutoRenderableDecisions: nonAutoRenderableDecisions + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var metasToArray = function metasToArray(metas) { + return Object.keys(metas).map(function (key) { + return { + id: key, + scope: metas[key].scope, + scopeDetails: metas[key].scopeDetails + }; + }); + }; + + var createClickStorage = (function () { + var clickStorage = {}; + + var storeClickMetrics = function storeClickMetrics(value) { + if (!clickStorage[value.selector]) { + clickStorage[value.selector] = {}; + } + + clickStorage[value.selector][value.meta.id] = { + scope: value.meta.scope, + scopeDetails: value.meta.scopeDetails + }; + }; + + var getClickSelectors = function getClickSelectors() { + return Object.keys(clickStorage); + }; + + var getClickMetasBySelector = function getClickMetasBySelector(selector) { + var metas = clickStorage[selector]; + + if (!metas) { + return {}; + } + + return metasToArray(clickStorage[selector]); + }; + + return { + storeClickMetrics: storeClickMetrics, + getClickSelectors: getClickSelectors, + getClickMetasBySelector: getClickMetasBySelector + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var getRedirectDetails = function getRedirectDetails(redirectDecisions) { + var decision = redirectDecisions[0]; + var items = decision.items, + id = decision.id, + scope = decision.scope, + scopeDetails = decision.scopeDetails; + var content = items[0].data.content; + return { + content: content, + decisions: [{ + id: id, + scope: scope, + scopeDetails: scopeDetails + }] + }; + }; + + var createRedirectHandler = (function (_ref) { + var collect = _ref.collect, + window = _ref.window, + logger = _ref.logger, + showContainers = _ref.showContainers; + return function (redirectDecisions) { + var _getRedirectDetails = getRedirectDetails(redirectDecisions), + content = _getRedirectDetails.content, + decisions = _getRedirectDetails.decisions; + + var documentMayUnload = true; + return collect({ + decisionsMeta: decisions, + documentMayUnload: documentMayUnload + }).then(function () { + window.location.replace(content); + }).catch(function () { + showContainers(); + logger.warn(REDIRECT_EXECUTION_ERROR); + }); + }; + }); + + var getPropositions = function getPropositions(_ref) { + var viewCache = _ref.viewCache, + viewName = _ref.viewName, + pageWideScopeDecisions = _ref.pageWideScopeDecisions; + + if (!viewName) { + return { + pageWideScopeDecisions: pageWideScopeDecisions, + viewPropositions: [] + }; + } + + return viewCache.getView(viewName).then(function (viewPropositions) { + return { + pageWideScopeDecisions: pageWideScopeDecisions, + viewPropositions: viewPropositions + }; + }); + }; + + var createAutorenderingHandler = (function (_ref2) { + var viewCache = _ref2.viewCache, + executeDecisions = _ref2.executeDecisions, + showContainers = _ref2.showContainers, + collect = _ref2.collect; + return function (_ref3) { + var viewName = _ref3.viewName, + pageWideScopeDecisions = _ref3.pageWideScopeDecisions, + nonAutoRenderableDecisions = _ref3.nonAutoRenderableDecisions; + return Promise.resolve(pageWideScopeDecisions).then(function (propositions) { + return getPropositions({ + viewCache: viewCache, + viewName: viewName, + executeDecisions: executeDecisions, + pageWideScopeDecisions: propositions + }); + }).then(function (propositions) { + executeDecisions(propositions.pageWideScopeDecisions).then(function (decisionsMeta) { + if (isNonEmptyArray(decisionsMeta)) { + collect({ + decisionsMeta: decisionsMeta + }); + } + }); + + if (viewName) { + executeDecisions(propositions.viewPropositions).then(function (decisionsMeta) { + collect({ + decisionsMeta: decisionsMeta, + viewName: viewName + }); + }); + } + + showContainers(); + return [].concat(_toConsumableArray(propositions.pageWideScopeDecisions), _toConsumableArray(propositions.viewPropositions)); + }).then(function (renderablePropositions) { + return { + decisions: _toConsumableArray(nonAutoRenderableDecisions), + propositions: [].concat(_toConsumableArray(addRenderAttemptedToDecisions({ + decisions: renderablePropositions, + renderAttempted: true + })), _toConsumableArray(addRenderAttemptedToDecisions({ + decisions: nonAutoRenderableDecisions, + renderAttempted: false + }))) + }; + }); + }; + }); + + var getViewPropositions = function getViewPropositions(_ref) { + var viewCache = _ref.viewCache, + viewName = _ref.viewName, + propositions = _ref.propositions; + + if (!viewName) { + return propositions; + } + + return viewCache.getView(viewName).then(function (viewPropositions) { + return [].concat(_toConsumableArray(viewPropositions), _toConsumableArray(propositions)); + }); + }; + + var buildFinalResult = function buildFinalResult(_ref2) { + var propositions = _ref2.propositions; + return { + decisions: propositions, + propositions: addRenderAttemptedToDecisions({ + decisions: propositions, + renderAttempted: false + }) + }; + }; + + var createNonRenderingHandler = (function (_ref3) { + var viewCache = _ref3.viewCache; + return function (_ref4) { + var viewName = _ref4.viewName, + redirectDecisions = _ref4.redirectDecisions, + pageWideScopeDecisions = _ref4.pageWideScopeDecisions, + nonAutoRenderableDecisions = _ref4.nonAutoRenderableDecisions; + var propositions = [].concat(_toConsumableArray(redirectDecisions), _toConsumableArray(pageWideScopeDecisions), _toConsumableArray(nonAutoRenderableDecisions)); + return Promise.resolve(propositions).then(function (items) { + return getViewPropositions({ + viewCache: viewCache, + viewName: viewName, + propositions: items + }); + }).then(function (items) { + return buildFinalResult({ + propositions: items + }); + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createPersonalization = function createPersonalization(_ref) { + var config = _ref.config, + logger = _ref.logger, + eventManager = _ref.eventManager; + var collect = createCollect({ + eventManager: eventManager, + mergeDecisionsMeta: mergeDecisionsMeta + }); + + var _createClickStorage = createClickStorage(), + getClickMetasBySelector = _createClickStorage.getClickMetasBySelector, + getClickSelectors = _createClickStorage.getClickSelectors, + storeClickMetrics = _createClickStorage.storeClickMetrics; + + var viewCache = createViewCacheManager(); + var modules = initDomActionsModules(storeClickMetrics); + var executeDecisions = createExecuteDecisions({ + modules: modules, + logger: logger, + executeActions: executeActions + }); + var handleRedirectDecisions = createRedirectHandler({ + collect: collect, + window: window, + logger: logger, + showContainers: showContainers + }); + var autoRenderingHandler = createAutorenderingHandler({ + viewCache: viewCache, + executeDecisions: executeDecisions, + showContainers: showContainers, + collect: collect + }); + var nonRenderingHandler = createNonRenderingHandler({ + viewCache: viewCache + }); + var responseHandler = createOnResponseHandler({ + autoRenderingHandler: autoRenderingHandler, + nonRenderingHandler: nonRenderingHandler, + groupDecisions: groupDecisions, + handleRedirectDecisions: handleRedirectDecisions, + showContainers: showContainers + }); + var fetchDataHandler = createFetchDataHandler({ + config: config, + responseHandler: responseHandler, + hideContainers: hideContainers, + mergeQuery: mergeQuery + }); + var onClickHandler = createOnClickHandler({ + mergeDecisionsMeta: mergeDecisionsMeta, + collectClicks: collectClicks, + getClickSelectors: getClickSelectors, + getClickMetasBySelector: getClickMetasBySelector + }); + var viewChangeHandler = createViewChangeHandler({ + mergeDecisionsMeta: mergeDecisionsMeta, + collect: collect, + executeDecisions: executeDecisions, + viewCache: viewCache + }); + return createComponent$3({ + logger: logger, + fetchDataHandler: fetchDataHandler, + viewChangeHandler: viewChangeHandler, + onClickHandler: onClickHandler, + isAuthoringModeEnabled: isAuthoringModeEnabled, + mergeQuery: mergeQuery, + viewCache: viewCache, + showContainers: showContainers + }); + }; + + createPersonalization.namespace = "Personalization"; + createPersonalization.configValidators = { + prehidingStyle: boundString().nonEmpty() + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectWeb = (function (window) { + return function (xdm) { + var web = { + webPageDetails: { + URL: window.location.href || window.location + }, + webReferrer: { + URL: window.document.referrer + } + }; + deepAssign(xdm, { + web: web + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var getScreenOrientationViaProperty = function getScreenOrientationViaProperty(window) { + var orientation = window.screen.orientation; + + if (orientation == null || orientation.type == null) { + return null; + } + + var parts = orientation.type.split("-"); + + if (parts.length === 0) { + return null; + } + + if (parts[0] !== "portrait" && parts[0] !== "landscape") { + return null; + } + + return parts[0]; + }; + + var getScreenOrientationViaMediaQuery = function getScreenOrientationViaMediaQuery(window) { + if (window.matchMedia("(orientation: portrait)").matches) { + return "portrait"; + } + + if (window.matchMedia("(orientation: landscape)").matches) { + return "landscape"; + } + + return null; + }; + + var injectDevice = (function (window) { + return function (xdm) { + var _window$screen = window.screen, + width = _window$screen.width, + height = _window$screen.height; + var device = { + screenHeight: height, + screenWidth: width + }; + var orientation = getScreenOrientationViaProperty(window) || getScreenOrientationViaMediaQuery(window); + + if (orientation) { + device.screenOrientation = orientation; + } + + deepAssign(xdm, { + device: device + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectEnvironment = (function (window) { + return function (xdm) { + var _window$document$docu = window.document.documentElement; + _window$document$docu = _window$document$docu === void 0 ? {} : _window$document$docu; + var clientWidth = _window$document$docu.clientWidth, + clientHeight = _window$document$docu.clientHeight; + var environment = { + type: "browser" + }; + + if (isNumber(clientWidth) && clientWidth >= 0 && isNumber(clientHeight) && clientHeight >= 0) { + environment.browserDetails = { + viewportWidth: Math.round(clientWidth), + viewportHeight: Math.round(clientHeight) + }; + } + + deepAssign(xdm, { + environment: environment + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectPlaceContext = (function (dateProvider) { + return function (xdm) { + var date = dateProvider(); + var placeContext = { + localTime: toISOStringLocal(date), + localTimezoneOffset: date.getTimezoneOffset() + }; + deepAssign(xdm, { + placeContext: placeContext + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectTimestamp = (function (dateProvider) { + return function (xdm) { + var timestamp = dateProvider().toISOString(); + deepAssign(xdm, { + timestamp: timestamp + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var libraryName = "https://ns.adobe.com/experience/alloy"; + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // The __VERSION__ keyword will be replace at alloy build time with the package.json version. + // see babel-plugin-version + var libraryVersion = "2.10.1"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var implementationDetails = (function (xdm) { + var implementationDetails = { + name: libraryName, + version: libraryVersion, + environment: "browser" + }; + deepAssign(xdm, { + implementationDetails: implementationDetails + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createComponent$2 = (function (config, logger, availableContexts, requiredContexts) { + var configuredContexts = config.context; + var contexts = flatMap(configuredContexts, function (context, i) { + if (availableContexts[context]) { + return [availableContexts[context]]; + } + + logger.warn("Invalid context[" + i + "]: '" + context + "' is not available."); + return []; + }).concat(requiredContexts); + return { + namespace: "Context", + lifecycle: { + onBeforeEvent: function onBeforeEvent(_ref) { + var event = _ref.event; + var xdm = {}; + contexts.forEach(function (context) { + return context(xdm); + }); + event.mergeXdm(xdm); + } + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var web = injectWeb(window); + var device = injectDevice(window); + var environment = injectEnvironment(window); + var placeContext = injectPlaceContext(function () { + return new Date(); + }); + var timestamp = injectTimestamp(function () { + return new Date(); + }); + var optionalContexts = { + web: web, + device: device, + environment: environment, + placeContext: placeContext + }; + var requiredContexts = [timestamp, implementationDetails]; + + var createContext = function createContext(_ref) { + var config = _ref.config, + logger = _ref.logger; + return createComponent$2(config, logger, optionalContexts, requiredContexts); + }; + + createContext.namespace = "Context"; + createContext.configValidators = { + context: boundArrayOf(boundString()).default(Object.keys(optionalContexts)) + }; + + var createComponent$1 = (function (_ref) { + var storedConsent = _ref.storedConsent, + taskQueue = _ref.taskQueue, + defaultConsent = _ref.defaultConsent, + consent = _ref.consent, + sendSetConsentRequest = _ref.sendSetConsentRequest, + validateSetConsentOptions = _ref.validateSetConsentOptions, + consentHashStore = _ref.consentHashStore, + doesIdentityCookieExist = _ref.doesIdentityCookieExist; + + var defaultConsentByPurpose = _defineProperty({}, GENERAL, defaultConsent); + + var storedConsentByPurpose = storedConsent.read(); + var identityCookieExists = doesIdentityCookieExist(); + var consentCookieExists = storedConsentByPurpose[GENERAL] !== undefined; + + if (!identityCookieExists || !consentCookieExists) { + consentHashStore.clear(); + } // If the identity cookie is gone, remove the consent cookie because the + // consent info is tied to the identity. + + + if (!identityCookieExists) { + storedConsent.clear(); + storedConsentByPurpose = {}; + } + + consent.initializeConsent(defaultConsentByPurpose, storedConsentByPurpose); + + var readCookieIfQueueEmpty = function readCookieIfQueueEmpty() { + if (taskQueue.length === 0) { + var storedConsentObject = storedConsent.read(); // Only read cookies when there are no outstanding setConsent + // requests. This helps with race conditions. + + if (storedConsentObject[GENERAL] !== undefined) { + consent.setConsent(storedConsentObject); + } + } + }; + + return { + commands: { + setConsent: { + optionsValidator: validateSetConsentOptions, + run: function run(_ref2) { + var consentOptions = _ref2.consent, + identityMap = _ref2.identityMap; + consent.suspend(); + var consentHashes = consentHashStore.lookup(consentOptions); + return taskQueue.addTask(function () { + if (consentHashes.isNew()) { + return sendSetConsentRequest({ + consentOptions: consentOptions, + identityMap: identityMap + }); + } + + return Promise.resolve(); + }).then(function () { + return consentHashes.save(); + }).finally(readCookieIfQueueEmpty); + } + } + }, + lifecycle: { + // Read the cookie here too because the consent cookie may change on any request + onResponse: readCookieIfQueueEmpty, + // Even when we get a failure HTTP status code, the consent cookie can + // still get updated. This could happen, for example, if the user is + // opted out in AudienceManager, but no consent cookie exists on the + // client. The request will be sent and the server will respond with a + // 403 Forbidden and a consent cookie. + onRequestFailure: readCookieIfQueueEmpty + } + }; + }); + + var serialize = function serialize(obj) { + if (Array.isArray(obj)) { + return obj.map(function (i) { + return serialize(i); + }); + } + + if (_typeof(obj) === "object" && obj !== null) { + return Object.keys(obj).sort().reduce(function (memo, key) { + memo[key] = serialize(obj[key]); + return memo; + }, {}); + } + + return obj; + }; + + var computeConsentHash = (function (obj) { + return crc32(JSON.stringify(serialize(obj))); + }); + + var _excluded = ["standard", "version"]; + + var getKey = function getKey(_ref) { + var standard = _ref.standard, + version = _ref.version; + return standard + "." + version; + }; + + var createConsentHashStore = (function (_ref2) { + var storage = _ref2.storage; + return { + clear: function clear() { + storage.clear(); + }, + lookup: function lookup(consentObjects) { + var currentHashes = {}; + + var getCurrentHash = function getCurrentHash(consentObject) { + var key = getKey(consentObject); + + consentObject.standard; + consentObject.version; + var rest = _objectWithoutProperties(consentObject, _excluded); + + if (!currentHashes[key]) { + currentHashes[key] = computeConsentHash(rest).toString(); + } + + return currentHashes[key]; + }; + + return { + isNew: function isNew() { + return consentObjects.some(function (consentObject) { + var key = getKey(consentObject); + var previousHash = storage.getItem(key); + return previousHash === null || previousHash !== getCurrentHash(consentObject); + }); + }, + save: function save() { + consentObjects.forEach(function (consentObject) { + var key = getKey(consentObject); + storage.setItem(key, getCurrentHash(consentObject)); + }); + } + }; + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createConsentRequestPayload = (function () { + var content = {}; + var payload = createRequestPayload({ + content: content, + addIdentity: function addIdentity(namespaceCode, identity) { + content.identityMap = content.identityMap || {}; + content.identityMap[namespaceCode] = content.identityMap[namespaceCode] || []; + content.identityMap[namespaceCode].push(identity); + } + }); + + payload.setConsent = function (consent) { + content.consent = consent; + }; + + return payload; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createConsentRequest = (function (consentRequestPayload) { + return createRequest({ + payload: consentRequestPayload, + getAction: function getAction() { + return "privacy/set-consent"; + }, + getUseSendBeacon: function getUseSendBeacon() { + return false; + } + }); + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createStoredConsent = (function (_ref) { + var parseConsentCookie = _ref.parseConsentCookie, + orgId = _ref.orgId, + cookieJar = _ref.cookieJar; + var consentCookieName = getNamespacedCookieName(orgId, CONSENT); + return { + read: function read() { + var cookieValue = cookieJar.get(consentCookieName); + return cookieValue ? parseConsentCookie(cookieValue) : {}; + }, + clear: function clear() { + cookieJar.remove(consentCookieName); + } + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectSendSetConsentRequest = (function (_ref) { + var createConsentRequestPayload = _ref.createConsentRequestPayload, + createConsentRequest = _ref.createConsentRequest, + sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest; + return function (_ref2) { + var consentOptions = _ref2.consentOptions, + identityMap = _ref2.identityMap; + var payload = createConsentRequestPayload(); + payload.setConsent(consentOptions); + + if (isObject(identityMap)) { + Object.keys(identityMap).forEach(function (key) { + identityMap[key].forEach(function (identity) { + payload.addIdentity(key, identity); + }); + }); + } + + var request = createConsentRequest(payload); + return sendEdgeNetworkRequest({ + request: request + }).then(function () {// Don't let response data disseminate beyond this + // point unless necessary. + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + /** + * Parses a consent cookie. + * @param {string} cookieValue Must be in the format a=b;c=d + * @returns {Object} An object where the keys are purpose names and the values + * are the consent status for the purpose. + */ + var parseConsentCookie = (function (cookieValue) { + var categoryPairs = cookieValue.split(";"); + return categoryPairs.reduce(function (consentByPurpose, categoryPair) { + var _categoryPair$split = categoryPair.split("="), + _categoryPair$split2 = _slicedToArray(_categoryPair$split, 2), + name = _categoryPair$split2[0], + value = _categoryPair$split2[1]; + + consentByPurpose[name] = value; + return consentByPurpose; + }, {}); + }); + + var validateSetConsentOptions = boundObjectOf({ + consent: boundArrayOf(boundAnything()).required().nonEmpty(), + identityMap: validateIdentityMap + }).noUnknownFields().required(); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createPrivacy = function createPrivacy(_ref) { + var config = _ref.config, + consent = _ref.consent, + sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest, + createNamespacedStorage = _ref.createNamespacedStorage; + var orgId = config.orgId, + defaultConsent = config.defaultConsent; + var storedConsent = createStoredConsent({ + parseConsentCookie: parseConsentCookie, + orgId: orgId, + cookieJar: reactorCookie + }); + var taskQueue = createTaskQueue(); + var sendSetConsentRequest = injectSendSetConsentRequest({ + createConsentRequestPayload: createConsentRequestPayload, + createConsentRequest: createConsentRequest, + sendEdgeNetworkRequest: sendEdgeNetworkRequest + }); + var storage = createNamespacedStorage(sanitizeOrgIdForCookieName(orgId) + ".consentHashes."); + var consentHashStore = createConsentHashStore({ + storage: storage.persistent + }); + var doesIdentityCookieExist = injectDoesIdentityCookieExist({ + orgId: orgId + }); + return createComponent$1({ + storedConsent: storedConsent, + taskQueue: taskQueue, + defaultConsent: defaultConsent, + consent: consent, + sendSetConsentRequest: sendSetConsentRequest, + validateSetConsentOptions: validateSetConsentOptions, + consentHashStore: consentHashStore, + doesIdentityCookieExist: doesIdentityCookieExist + }); + }; + + createPrivacy.namespace = "Privacy"; + + /* + Copyright 20219 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createEventMergeId = (function () { + return { + eventMergeId: v4_1() + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createComponent = (function (_ref) { + var createEventMergeId = _ref.createEventMergeId; + return { + commands: { + createEventMergeId: { + run: createEventMergeId + } + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createEventMerge = function createEventMerge() { + return createComponent({ + createEventMergeId: createEventMergeId + }); + }; + + createEventMerge.namespace = "EventMerge"; + createEventMerge.configValidators = {}; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createLibraryInfo = function createLibraryInfo() { + return { + commands: { + getLibraryInfo: { + run: function run() { + return { + libraryInfo: { + version: libraryVersion + } + }; + } + } + } + }; + }; + + createLibraryInfo.namespace = "LibraryInfo"; + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var processResponse = (function (_ref) { + var response = _ref.response; + return { + inferences: response.getPayloadsByType("rtml:inferences") + }; + }); + + /* + Copyright 2021 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createMachineLearning = function createMachineLearning() { + return { + lifecycle: { + onResponse: processResponse + }, + commands: {} + }; + }; + + createMachineLearning.namespace = "MachineLearning"; + createMachineLearning.configValidators = {}; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + // TODO: Figure out how sub-components will be made available/registered + + var componentCreators = [createDataCollector, createActivityCollector, createIdentity, createAudiences, createPersonalization, createContext, createPrivacy, createEventMerge, createLibraryInfo, createMachineLearning]; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var CONFIG_DOC_URI = "https://adobe.ly/3sHh553"; + + var buildSchema = function buildSchema(coreConfigValidators, componentCreators) { + var schema = {}; + reactorObjectAssign(schema, coreConfigValidators); + componentCreators.forEach(function (createComponent) { + var configValidators = createComponent.configValidators; + reactorObjectAssign(schema, configValidators); + }); + return schema; + }; + + var transformOptions = function transformOptions(schema, options) { + try { + var validator = boundObjectOf(schema).noUnknownFields().required(); + return validator(options); + } catch (e) { + throw new Error("Resolve these configuration problems:\n\t - " + e.message.split("\n").join("\n\t - ") + "\nFor configuration documentation see: " + CONFIG_DOC_URI); + } + }; + + var buildAndValidateConfig = (function (_ref) { + var options = _ref.options, + componentCreators = _ref.componentCreators, + coreConfigValidators = _ref.coreConfigValidators, + createConfig = _ref.createConfig, + logger = _ref.logger, + setDebugEnabled = _ref.setDebugEnabled; + var schema = buildSchema(coreConfigValidators, componentCreators); + var config = createConfig(transformOptions(schema, options)); + setDebugEnabled(config.debugEnabled, { + fromConfig: true + }); + logger.logOnInstanceConfigured({ + config: config + }); + return config; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var initializeComponents = (function (_ref) { + var componentCreators = _ref.componentCreators, + lifecycle = _ref.lifecycle, + componentRegistry = _ref.componentRegistry, + getImmediatelyAvailableTools = _ref.getImmediatelyAvailableTools; + componentCreators.forEach(function (createComponent) { + var namespace = createComponent.namespace; // TO-DOCUMENT: Helpers that we inject into factories. + + var tools = getImmediatelyAvailableTools(namespace); + var component; + + try { + component = createComponent(tools); + } catch (error) { + throw stackError({ + error: error, + message: "[" + namespace + "] An error occurred during component creation." + }); + } + + componentRegistry.register(namespace, component); + }); + return lifecycle.onComponentsRegistered({ + lifecycle: lifecycle + }).then(function () { + return componentRegistry; + }); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var createConfig = function createConfig(options) { + return reactorObjectAssign({}, options); + }; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var EDGE = "edge.adobedc.net"; + var ID_THIRD_PARTY = "adobedc.demdex.net"; + + var EDGE_BASE_PATH = "ee"; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createCoreConfigs = (function () { + return { + debugEnabled: boundBoolean().default(false), + defaultConsent: boundEnumOf(IN, OUT, PENDING).default(IN), + edgeConfigId: boundString().unique().required(), + edgeDomain: boundString().domain().default(EDGE), + edgeBasePath: boundString().nonEmpty().default(EDGE_BASE_PATH), + orgId: boundString().unique().required(), + onBeforeEventSend: boundCallback().default(noop$1) + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectHandleError = (function (_ref) { + var errorPrefix = _ref.errorPrefix, + logger = _ref.logger; + return function (error, operation) { + var err = toError(error); // In the case of declined consent, we've opted to not reject the promise + // returned to the customer, but instead resolve the promise with an + // empty result object. + + if (err.code === DECLINED_CONSENT_ERROR_CODE) { + logger.warn("The " + operation + " could not fully complete. " + err.message); + return {}; + } + + updateErrorMessage({ + error: err, + message: errorPrefix + " " + err.message + }); + throw err; + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectSendFetchRequest = (function (_ref) { + var fetch = _ref.fetch; + return function (url, body) { + return fetch(url, { + method: "POST", + cache: "no-cache", + credentials: "include", + // To set the cookie header in the request. + headers: { + "Content-Type": "text/plain; charset=UTF-8" + }, + referrer: "client", + body: body + }).then(function (response) { + return response.text().then(function (responseBody) { + return { + statusCode: response.status, + // We expose headers through a function instead of creating an object + // with all the headers up front largely because the native + // request.getResponseHeader method is case-insensitive but also because it prevents + // us from having to add header parsing logic when using XHR to make requests. + getHeader: function getHeader(name) { + return response.headers.get(name); + }, + body: responseBody + }; + }); + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectSendXhrRequest = (function (_ref) { + var XMLHttpRequest = _ref.XMLHttpRequest; + return function (url, body) { + return new Promise(function (resolve, reject) { + var request = new XMLHttpRequest(); + + request.onreadystatechange = function () { + if (request.readyState === 4) { + if (request.status === 0) { + reject(new Error("Request aborted.")); + } else { + resolve({ + statusCode: request.status, + // We expose headers through a function instead of creating an object + // with all the headers up front because: + // 1. It avoids having to add header parsing code to get all headers. + // 2. The native request.getResponseHeader method is case-insensitive. + getHeader: function getHeader(name) { + return request.getResponseHeader(name); + }, + body: request.responseText + }); + } + } + }; + + request.onloadstart = function () { + request.responseType = "text"; + }; + + request.open("POST", url, true); + request.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); + request.withCredentials = true; + request.onerror = reject; + request.onabort = reject; + request.send(body); + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var injectSendBeaconRequest = (function (_ref) { + var sendBeacon = _ref.sendBeacon, + sendFetchRequest = _ref.sendFetchRequest, + logger = _ref.logger; + return function (url, body) { + var blob = new Blob([body], { + type: "text/plain; charset=UTF-8" + }); + + if (!sendBeacon(url, blob)) { + logger.info("Unable to use `sendBeacon`; falling back to `fetch`."); + return sendFetchRequest(url, body); + } // Using sendBeacon, we technically don't get a response back from + // the server, but we'll resolve the promise with an object to maintain + // consistency with other network strategies. + + + return Promise.resolve({ + statusCode: 204, + getHeader: function getHeader() { + return null; + }, + body: "" + }); + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createLogger = (function (_ref) { + var getDebugEnabled = _ref.getDebugEnabled, + console = _ref.console, + getMonitors = _ref.getMonitors, + context = _ref.context; + var prefix = "[" + context.instanceName + "]"; + + if (context.componentName) { + prefix += " [" + context.componentName + "]"; + } + + var notifyMonitors = function notifyMonitors(method, data) { + var monitors = getMonitors(); + + if (monitors.length > 0) { + var dataWithContext = reactorObjectAssign({}, context, data); + monitors.forEach(function (monitor) { + if (monitor[method]) { + monitor[method](dataWithContext); + } + }); + } + }; + + var log = function log(level) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + notifyMonitors("onBeforeLog", { + level: level, + arguments: rest + }); + + if (getDebugEnabled()) { + console[level].apply(console, [prefix].concat(rest)); + } + }; + + return { + get enabled() { + return getMonitors().length > 0 || getDebugEnabled(); + }, + + logOnInstanceCreated: function logOnInstanceCreated(data) { + notifyMonitors("onInstanceCreated", data); + log("info", "Instance initialized."); + }, + logOnInstanceConfigured: function logOnInstanceConfigured(data) { + notifyMonitors("onInstanceConfigured", data); + log("info", "Instance configured. Computed configuration:", data.config); + }, + logOnBeforeCommand: function logOnBeforeCommand(data) { + notifyMonitors("onBeforeCommand", data); + log("info", "Executing " + data.commandName + " command. Options:", data.options); + }, + logOnCommandResolved: function logOnCommandResolved(data) { + notifyMonitors("onCommandResolved", data); + log("info", data.commandName + " command resolved. Result:", data.result); + }, + logOnCommandRejected: function logOnCommandRejected(data) { + notifyMonitors("onCommandRejected", data); + log("error", data.commandName + " command was rejected. Error:", data.error); + }, + logOnBeforeNetworkRequest: function logOnBeforeNetworkRequest(data) { + notifyMonitors("onBeforeNetworkRequest", data); + log("info", "Request " + data.requestId + ": Sending request.", data.payload); + }, + logOnNetworkResponse: function logOnNetworkResponse(data) { + notifyMonitors("onNetworkResponse", data); + var messagesSuffix = data.parsedBody || data.body ? "response body:" : "no response body."; + log("info", "Request " + data.requestId + ": Received response with status code " + data.statusCode + " and " + messagesSuffix, data.parsedBody || data.body); + }, + logOnNetworkError: function logOnNetworkError(data) { + notifyMonitors("onNetworkError", data); + log("error", "Request " + data.requestId + ": Network request failed.", data.error); + }, + + /** + * Outputs informational message to the web console. In some + * browsers a small "i" icon is displayed next to these items + * in the web console's log. + * @param {...*} arg Any argument to be logged. + */ + info: log.bind(null, "info"), + + /** + * Outputs a warning message to the web console. + * @param {...*} arg Any argument to be logged. + */ + warn: log.bind(null, "warn"), + + /** + * Outputs an error message to the web console. + * @param {...*} arg Any argument to be logged. + */ + error: log.bind(null, "error") + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var EVENT_CANCELLATION_MESSAGE = "Event was canceled because the onBeforeEventSend callback returned false."; + var createEventManager = (function (_ref) { + var config = _ref.config, + logger = _ref.logger, + lifecycle = _ref.lifecycle, + consent = _ref.consent, + createEvent = _ref.createEvent, + createDataCollectionRequestPayload = _ref.createDataCollectionRequestPayload, + createDataCollectionRequest = _ref.createDataCollectionRequest, + sendEdgeNetworkRequest = _ref.sendEdgeNetworkRequest; + var onBeforeEventSend = config.onBeforeEventSend; + return { + createEvent: createEvent, + + /** + * Sends an event. This includes running the event and payload through + * the appropriate lifecycle hooks, sending the request to the server, + * and handling the response. + * @param {Object} event This will be JSON stringified and used inside + * the request payload. + * @param {Object} [options] + * @param {boolean} [options.renderDecisions=false] + * @param {Array} [options.decisionScopes] + * @param {Object} [options.serverState] + * This will be passed to components + * so they can take appropriate action. + * @returns {*} + */ + sendEvent: function sendEvent(event) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _options$renderDecisi = options.renderDecisions, + renderDecisions = _options$renderDecisi === void 0 ? false : _options$renderDecisi, + decisionScopes = options.decisionScopes, + serverState = options.serverState; + var payload = createDataCollectionRequestPayload(); + var request = createDataCollectionRequest(payload); + var onResponseCallbackAggregator = createCallbackAggregator(); + var onRequestFailureCallbackAggregator = createCallbackAggregator(); + return lifecycle.onBeforeEvent({ + event: event, + renderDecisions: renderDecisions, + decisionScopes: decisionScopes, + onResponse: onResponseCallbackAggregator.add, + onRequestFailure: onRequestFailureCallbackAggregator.add + }).then(function () { + payload.addEvent(event); + return consent.awaitConsent(); + }).then(function () { + try { + // NOTE: this calls onBeforeEventSend callback (if configured) + event.finalize(onBeforeEventSend); + } catch (error) { + var throwError = function throwError() { + throw error; + }; + + onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure); + return onRequestFailureCallbackAggregator.call({ + error: error + }).then(throwError, throwError); + } // if the callback returns false, the event should not be sent + + + if (!event.shouldSend()) { + onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure); + logger.info(EVENT_CANCELLATION_MESSAGE); + var error = new Error(EVENT_CANCELLATION_MESSAGE); + return onRequestFailureCallbackAggregator.call({ + error: error + }).then(function () {// Ensure the promise gets resolved with undefined instead + // of an array of return values from the callbacks. + }); + } + + return sendEdgeNetworkRequest({ + request: request, + runOnResponseCallbacks: onResponseCallbackAggregator.call, + runOnRequestFailureCallbacks: onRequestFailureCallbackAggregator.call, + serverState: serverState + }); + }); + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var STATE_STORE_HANDLE_TYPE = "state:store"; + var createCookieTransfer = (function (_ref) { + var cookieJar = _ref.cookieJar, + orgId = _ref.orgId, + apexDomain = _ref.apexDomain; + return { + getPathFromCookie: function getPathFromCookie() { + return cookieJar.get(getNamespacedCookieName(orgId, EDGE_PATH)); + }, + + /** + * When sending to a third-party endpoint, the endpoint won't be able to + * access first-party cookies, therefore we transfer cookies into + * the request body so they can be read by the server. + */ + cookiesToPayload: function cookiesToPayload(payload, endpointDomain) { + var isEndpointFirstParty = endsWith(endpointDomain, apexDomain); + var state = { + domain: apexDomain, + cookiesEnabled: true + }; // If the endpoint is first-party, there's no need to transfer cookies + // to the payload since they'll be automatically passed through cookie + // headers. + + if (!isEndpointFirstParty) { + var cookies = cookieJar.get(); + var entries = Object.keys(cookies).filter(function (name) { + // We have a contract with the server that we will pass + // all cookies whose names are namespaced according to the + // logic in isNamespacedCookieName as well as any legacy + // cookie names (so that the server can handle migrating + // identities on websites previously using Visitor.js) + return isNamespacedCookieName(orgId, name); + }).map(function (qualifyingCookieName) { + return { + key: qualifyingCookieName, + value: cookies[qualifyingCookieName] + }; + }); + + if (entries.length) { + state.entries = entries; + } + } + + payload.mergeState(state); + }, + + /** + * When receiving from a third-party endpoint, the endpoint won't be able to + * write first-party cookies, therefore we write first-party cookies + * as directed in the response body. + */ + responseToCookies: function responseToCookies(response) { + response.getPayloadsByType(STATE_STORE_HANDLE_TYPE).forEach(function (stateItem) { + var options = { + domain: apexDomain + }; + + if (stateItem.maxAge !== undefined) { + // cookieJar expects "expires" in days + options.expires = convertTimes(SECOND, DAY, stateItem.maxAge); + } + + cookieJar.set(stateItem.key, stateItem.value, options); + }); + } + }; + }); + + var apiVersion = "v1"; + + var extractResponseFromServerState = function extractResponseFromServerState(serverState) { + var _serverState$response = serverState.response, + response = _serverState$response === void 0 ? {} : _serverState$response; + var _response$headers = response.headers, + headers = _response$headers === void 0 ? {} : _response$headers, + _response$body = response.body, + body = _response$body === void 0 ? {} : _response$body; + + var getHeader = function getHeader(key) { + return headers[key]; + }; + + return { + statusCode: 200, + body: JSON.stringify(body), + parsedBody: body, + getHeader: getHeader + }; + }; + + var injectSendEdgeNetworkRequest = (function (_ref) { + var config = _ref.config, + lifecycle = _ref.lifecycle, + cookieTransfer = _ref.cookieTransfer, + sendNetworkRequest = _ref.sendNetworkRequest, + createResponse = _ref.createResponse, + processWarningsAndErrors = _ref.processWarningsAndErrors; + var edgeDomain = config.edgeDomain, + edgeBasePath = config.edgeBasePath, + edgeConfigId = config.edgeConfigId; + /** + * Sends a network request that is aware of payload interfaces, + * lifecycle methods, configured edge domains, response structures, etc. + */ + + return function (_ref2) { + var request = _ref2.request, + _ref2$runOnResponseCa = _ref2.runOnResponseCallbacks, + runOnResponseCallbacks = _ref2$runOnResponseCa === void 0 ? noop$1 : _ref2$runOnResponseCa, + _ref2$runOnRequestFai = _ref2.runOnRequestFailureCallbacks, + runOnRequestFailureCallbacks = _ref2$runOnRequestFai === void 0 ? noop$1 : _ref2$runOnRequestFai, + _ref2$serverState = _ref2.serverState, + serverState = _ref2$serverState === void 0 ? undefined : _ref2$serverState; + var onResponseCallbackAggregator = createCallbackAggregator(); + onResponseCallbackAggregator.add(lifecycle.onResponse); + onResponseCallbackAggregator.add(runOnResponseCallbacks); + var onRequestFailureCallbackAggregator = createCallbackAggregator(); + onRequestFailureCallbackAggregator.add(lifecycle.onRequestFailure); + onRequestFailureCallbackAggregator.add(runOnRequestFailureCallbacks); + return lifecycle.onBeforeRequest({ + request: request, + onResponse: onResponseCallbackAggregator.add, + onRequestFailure: onRequestFailureCallbackAggregator.add + }).then(function () { + var endpointDomain = request.getUseIdThirdPartyDomain() ? ID_THIRD_PARTY : edgeDomain; + var pathFromCookie = cookieTransfer.getPathFromCookie(); + var basePath = pathFromCookie !== undefined ? pathFromCookie : endpointDomain + "/" + edgeBasePath; + var url = "https://" + basePath + "/" + apiVersion + "/" + request.getAction() + "?configId=" + edgeConfigId + "&requestId=" + request.getId(); + cookieTransfer.cookiesToPayload(request.getPayload(), endpointDomain); + return serverState ? extractResponseFromServerState(serverState) : sendNetworkRequest({ + requestId: request.getId(), + url: url, + payload: request.getPayload(), + useSendBeacon: request.getUseSendBeacon() + }); + }).then(function (networkResponse) { + processWarningsAndErrors(networkResponse); + return networkResponse; + }).catch(function (error) { + // Regardless of whether the network call failed, an unexpected status + // code was returned, or the response body was malformed, we want to call + // the onRequestFailure callbacks, but still throw the exception. + var throwError = function throwError() { + throw error; + }; + + return onRequestFailureCallbackAggregator.call({ + error: error + }).then(throwError, throwError); + }).then(function (_ref3) { + var parsedBody = _ref3.parsedBody, + getHeader = _ref3.getHeader; + // Note that networkResponse.parsedBody may be undefined if it was a + // 204 No Content response. That's fine. + var response = createResponse({ + content: parsedBody, + getHeader: getHeader + }); + cookieTransfer.responseToCookies(response); // Notice we're calling the onResponse lifecycle method even if there are errors + // inside the response body. This is because the full request didn't actually fail-- + // only portions of it that are considered non-fatal (a specific, non-critical + // Konductor plugin, for example). + + return onResponseCallbackAggregator.call({ + response: response + }).then(function (returnValues) { + // Merges all returned objects from all `onResponse` callbacks into + // a single object that can later be returned to the customer. + var lifecycleOnResponseReturnValues = returnValues.shift() || []; + var consumerOnResponseReturnValues = returnValues.shift() || []; + var lifecycleOnBeforeRequestReturnValues = returnValues; + return reactorObjectAssign.apply(void 0, [{}].concat(_toConsumableArray(lifecycleOnResponseReturnValues), _toConsumableArray(consumerOnResponseReturnValues), _toConsumableArray(lifecycleOnBeforeRequestReturnValues))); + }); + }); + }; + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var NO_CONTENT = 204; + var TOO_MANY_REQUESTS = 429; + var BAD_GATEWAY = 502; + var SERVICE_UNAVAILABLE = 503; + var GATEWAY_TIMEOUT = 504; + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var MESSAGE_PREFIX = "The server responded with a"; + var injectProcessWarningsAndErrors = (function (_ref) { + var logger = _ref.logger; + return function (networkResponse) { + var statusCode = networkResponse.statusCode, + body = networkResponse.body, + parsedBody = networkResponse.parsedBody; + + if (statusCode < 200 || statusCode >= 300 || !parsedBody && statusCode !== NO_CONTENT || parsedBody && !Array.isArray(parsedBody.handle)) { + var bodyToLog = parsedBody ? JSON.stringify(parsedBody, null, 2) : body; + var messageSuffix = bodyToLog ? "response body:\n" + bodyToLog : "no response body."; + throw new Error(MESSAGE_PREFIX + " status code " + statusCode + " and " + messageSuffix); + } + + if (parsedBody) { + var _parsedBody$warnings = parsedBody.warnings, + warnings = _parsedBody$warnings === void 0 ? [] : _parsedBody$warnings, + _parsedBody$errors = parsedBody.errors, + errors = _parsedBody$errors === void 0 ? [] : _parsedBody$errors; + warnings.forEach(function (warning) { + logger.warn(MESSAGE_PREFIX + " warning:", warning); + }); + errors.forEach(function (error) { + logger.error(MESSAGE_PREFIX + " non-fatal error:", error); + }); + } + }; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var MAX_RETRIES = 3; + var RETRYABLE_STATUS_CODES = [TOO_MANY_REQUESTS, SERVICE_UNAVAILABLE, BAD_GATEWAY, GATEWAY_TIMEOUT]; // These rules are in accordance with + // https://git.corp.adobe.com/pages/experience-edge/konductor/#/apis/errors?id=handling-4xx-and-5xx-responses + + var isRequestRetryable = (function (_ref) { + var response = _ref.response, + retriesAttempted = _ref.retriesAttempted; + return retriesAttempted < MAX_RETRIES && includes(RETRYABLE_STATUS_CODES, response.statusCode); + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + + var FIRST_DELAY_MILLIS = 1000; + var INCREMENTAL_DELAY_MILLIS = 1000; // When the target delay is randomized, make it within the range of this percentage above or below the target delay. + + var MAX_RANDOM_VARIANCE_PERCENTAGE = 0.3; + + var calculateRetryDelay = function calculateRetryDelay(retriesAttempted) { + var targetDelay = FIRST_DELAY_MILLIS + retriesAttempted * INCREMENTAL_DELAY_MILLIS; + var maxVariance = targetDelay * MAX_RANDOM_VARIANCE_PERCENTAGE; + var minDelay = targetDelay - maxVariance; + var maxDelay = targetDelay + maxVariance; + var randomizedDelayWithinRange = Math.round(minDelay + Math.random() * (maxDelay - minDelay)); + return randomizedDelayWithinRange; + }; + + var getDelayFromHeader = function getDelayFromHeader(response) { + // According to the HTTP spec, if the header is defined, its value will be a string that + // represents either: + // * An integer indicating the number of seconds to delay. + // * A date after which a retry may occur. The date would be in HTTP-date + // format (https://tools.ietf.org/html/rfc7231#section-7.1.1.1). When debugging, it can + // be helpful to know that this is the same format that a JavaScript date's + // toGMTString() returns. + var headerValue = response.getHeader(RETRY_AFTER); + var delayInMillis; + + if (headerValue) { + var headerValueInt = parseInt(headerValue, 10); + + if (isInteger(headerValueInt)) { + delayInMillis = headerValueInt * 1000; + } else { + delayInMillis = Math.max(0, new Date(headerValue).getTime() - new Date().getTime()); + } + } + + return delayInMillis; + }; // These rules are in accordance with + // https://git.corp.adobe.com/pages/experience-edge/konductor/#/apis/errors?id=handling-4xx-and-5xx-responses + // For retry delays that don't come from a Retry-After response header, we try to stick with the following best + // practices outlined in https://docs.microsoft.com/en-us/azure/architecture/best-practices/transient-faults: + // * Incremental retry + // * Random interval + + + var getRequestRetryDelay = (function (_ref) { + var response = _ref.response, + retriesAttempted = _ref.retriesAttempted; + // Technically, only 429 or 503 responses should have a Retry-After header, but we'll respect the + // header if we find it on any response. + var delayInMillis = getDelayFromHeader(response); // Note that the value of delay may be 0 at this point, which would be a valid delay we want to use + // and not override, which is why we don't do: + // if (!delay) { ... } + + if (delayInMillis === undefined) { + delayInMillis = calculateRetryDelay(retriesAttempted); + } + + return delayInMillis; + }); + + /* + Copyright 2019 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + var createNamespacedStorage = injectStorage(window); + var _window = window, + console$1 = _window.console, + fetch = _window.fetch, + navigator = _window.navigator, + XMLHttpRequest = _window.XMLHttpRequest; // set this up as a function so that monitors can be added at anytime + // eslint-disable-next-line no-underscore-dangle + + var getMonitors = function getMonitors() { + return window.__alloyMonitors || []; + }; + + var coreConfigValidators = createCoreConfigs(); + var apexDomain = getApexDomain(window, reactorCookie); + var sendFetchRequest = isFunction(fetch) ? injectSendFetchRequest({ + fetch: fetch + }) : injectSendXhrRequest({ + XMLHttpRequest: XMLHttpRequest + }); + var fireReferrerHideableImage = injectFireReferrerHideableImage(); + var createExecuteCommand = function createExecuteCommand(_ref) { + var instanceName = _ref.instanceName, + _ref$logController = _ref.logController, + setDebugEnabled = _ref$logController.setDebugEnabled, + logger = _ref$logController.logger, + createComponentLogger = _ref$logController.createComponentLogger; + var componentRegistry = createComponentRegistry(); + var lifecycle = createLifecycle(componentRegistry); + + var setDebugCommand = function setDebugCommand(options) { + setDebugEnabled(options.enabled, { + fromConfig: false + }); + }; + + var configureCommand = function configureCommand(options) { + var config = buildAndValidateConfig({ + options: options, + componentCreators: componentCreators, + coreConfigValidators: coreConfigValidators, + createConfig: createConfig, + logger: logger, + setDebugEnabled: setDebugEnabled + }); + var cookieTransfer = createCookieTransfer({ + cookieJar: reactorCookie, + orgId: config.orgId, + apexDomain: apexDomain + }); + var sendBeaconRequest = isFunction(navigator.sendBeacon) ? injectSendBeaconRequest({ + // Without the bind(), the browser will complain about an + // illegal invocation. + sendBeacon: navigator.sendBeacon.bind(navigator), + sendFetchRequest: sendFetchRequest, + logger: logger + }) : sendFetchRequest; + var sendNetworkRequest = injectSendNetworkRequest({ + logger: logger, + sendFetchRequest: sendFetchRequest, + sendBeaconRequest: sendBeaconRequest, + isRequestRetryable: isRequestRetryable, + getRequestRetryDelay: getRequestRetryDelay + }); + var processWarningsAndErrors = injectProcessWarningsAndErrors({ + logger: logger + }); + var extractEdgeInfo = injectExtractEdgeInfo({ + logger: logger + }); + var createResponse = injectCreateResponse({ + extractEdgeInfo: extractEdgeInfo + }); + var sendEdgeNetworkRequest = injectSendEdgeNetworkRequest({ + config: config, + lifecycle: lifecycle, + cookieTransfer: cookieTransfer, + sendNetworkRequest: sendNetworkRequest, + createResponse: createResponse, + processWarningsAndErrors: processWarningsAndErrors + }); + var generalConsentState = createConsentStateMachine({ + logger: logger + }); + var consent = createConsent({ + generalConsentState: generalConsentState, + logger: logger + }); + var eventManager = createEventManager({ + config: config, + logger: logger, + lifecycle: lifecycle, + consent: consent, + createEvent: createEvent, + createDataCollectionRequestPayload: createDataCollectionRequestPayload, + createDataCollectionRequest: createDataCollectionRequest, + sendEdgeNetworkRequest: sendEdgeNetworkRequest + }); + return initializeComponents({ + componentCreators: componentCreators, + lifecycle: lifecycle, + componentRegistry: componentRegistry, + getImmediatelyAvailableTools: function getImmediatelyAvailableTools(componentName) { + var componentLogger = createComponentLogger(componentName); + return { + config: config, + consent: consent, + eventManager: eventManager, + fireReferrerHideableImage: fireReferrerHideableImage, + logger: componentLogger, + lifecycle: lifecycle, + sendEdgeNetworkRequest: sendEdgeNetworkRequest, + handleError: injectHandleError({ + errorPrefix: "[" + instanceName + "] [" + componentName + "]", + logger: componentLogger + }), + createNamespacedStorage: createNamespacedStorage + }; + } + }); + }; + + var handleError = injectHandleError({ + errorPrefix: "[" + instanceName + "]", + logger: logger + }); + var executeCommand = injectExecuteCommand({ + logger: logger, + configureCommand: configureCommand, + setDebugCommand: setDebugCommand, + handleError: handleError, + validateCommandOptions: validateCommandOptions + }); + return executeCommand; + }; + var core = (function () { + // eslint-disable-next-line no-underscore-dangle + var instanceNames = window.__alloyNS; + + if (instanceNames) { + instanceNames.forEach(function (instanceName) { + var logController = createLogController({ + console: console$1, + locationSearch: window.location.search, + createLogger: createLogger, + instanceName: instanceName, + createNamespacedStorage: createNamespacedStorage, + getMonitors: getMonitors + }); + var executeCommand = createExecuteCommand({ + instanceName: instanceName, + logController: logController + }); + var instance = createInstanceFunction(executeCommand); + var queue = window[instanceName].q; + queue.push = instance; + logController.logger.logOnInstanceCreated({ + instance: instance + }); + queue.forEach(instance); + }); + } + }); + + /* + Copyright 2020 Adobe. All rights reserved. + This file is licensed to you under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. You may obtain a copy + of the License at http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software distributed under + the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + OF ANY KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. + */ + core(); + +})(); diff --git a/react-shopping-cart-demo/public/alloy.min.js b/react-shopping-cart-demo/public/alloy.min.js new file mode 100644 index 0000000..43c1ced --- /dev/null +++ b/react-shopping-cart-demo/public/alloy.min.js @@ -0,0 +1,13 @@ +/** + * Copyright 2019 Adobe. All rights reserved. + * This file is licensed to you under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. You may obtain a copy + * of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under + * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS + * OF ANY KIND, either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ + +!function(){"use strict";if(document.documentMode&&document.documentMode<11)console.warn("The Adobe Experience Cloud Web SDK does not support IE 10 and below.");else{var e="Chrome",n="Edge",t="EdgeChromium",r="Unknown",o=function(e,n){return-1!==e.indexOf(n)},i=[e,n,t,"IE",r],a=function(e){return o(i,e)},c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,f=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(n).map((function(e){return n[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,n){for(var t,r,o=Ao(e),i=1;i1?t-1:0),o=1;o>>1:t>>>1;e.push(t)}return function(n,t){n=unescape(encodeURIComponent(n)),t||(t=0),t^=-1;for(var r=0;r>>8^e[o]}return(t^=-1)>>>0}}(),E=function(){var e={};return e.promise=new Promise((function(n,t){e.resolve=n,e.reject=t})),e},I=function(e,n){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:document,i=o.createElement(e);return Object.keys(n).forEach((function(e){i.setAttribute(e,n[e])})),R(i,t),r.forEach((function(e){return D(i,e)})),i},k="BODY",O="IFRAME",P="IMG",q="STYLE",x="SCRIPT",A=function(e){var n=e.src,t=e.currentDocument,r=void 0===t?document:t;return new Promise((function(e,t){S(P,{src:n},{onload:e,onerror:t,onabort:t},[],r)}))},N=function(e){return"function"==typeof e},M=function(e){return Array.isArray(e)&&e.length>0},j=function(e){return Array.isArray(e)?e:null==e?[]:[].slice.call(e)},T=function(e,n){return j(e.querySelectorAll(n))},U=function(e,n){return e.substr(0,n.length)===n},B=":shadow",F=function(e,n){var t=n.trim();return U(t,">")?window.document.documentMode?t.substring(1).trim():(e instanceof Element||e instanceof HTMLDocument?":scope":":host")+" "+t:t},_=function(e,n){if(!window.document.documentElement.attachShadow)return T(e,n.replace(B,""));var t=function(e){return e.split(B)}(n);if(t.length<2)return T(e,n);for(var r=e,o=0;o1&&void 0!==arguments[1]?arguments[1]:document;return H(e)?_(n,e):T(n,e)},L={childList:!0,subtree:!0},z=function(e){return new Error("Could not find: "+e)},W=function(e){return new Promise(e)},J=function(e){return N(e.MutationObserver)},Q=function(e,n,t,r,o){return W((function(i,a){var c=new e.MutationObserver((function(){var e=o(t);M(e)&&(c.disconnect(),i(e))}));setTimeout((function(){c.disconnect(),a(z(t))}),r),c.observe(n,L)}))},X=function(e){return"visible"===e.visibilityState},G=function(e,n,t,r){return W((function(o,i){!function t(){var i=r(n);M(i)?o(i):e.requestAnimationFrame(t)}(),setTimeout((function(){i(z(n))}),t)}))},$=function(e,n,t){return W((function(r,o){!function n(){var o=t(e);M(o)?r(o):setTimeout(n,100)}(),setTimeout((function(){o(z(e))}),n)}))},K=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:V,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:document,i=n(e);return M(i)?Promise.resolve(i):J(r)?Q(r,o,e,t,n):X(o)?G(r,e,t,n):$(e,t,n)},Y=function(e){var n=e.parentNode;return n?n.removeChild(e):null},Z={name:"Adobe Alloy"},ee={style:{display:"none",width:0,height:0}},ne=function(e,n){return Array.prototype.concat.apply([],e.map(n))},te="com.adobe.alloy.",re=te+"getTld",oe=function(e,n){for(var t,r,o="",i=e.location.hostname.toLowerCase().split("."),a=1;a0},ve=function(){},me=function(e,n,t){var r=String(e),o=String(t);if(r.length>=n||0===o.length)return r;for(var i=n-r.length;i>o.length;)o+=o;return o.slice(0,i)+r},he=function(e,n,t,r){n=n||"&",t=t||"=";var o={};if("string"!=typeof e||0===e.length)return o;var i=/\+/g;e=e.split(n);var a=1e3;r&&"number"==typeof r.maxKeys&&(a=r.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u=0?(s=g.substr(0,p),f=g.substr(p+1)):(s=g,f=""),d=decodeURIComponent(s),l=decodeURIComponent(f),Lo(o,d)?Array.isArray(o[d])?o[d].push(l):o[d]=[o[d],l]:o[d]=l}return o},ye=function(e){switch(To(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},we=function(e,n,t,r){return n=n||"&",t=t||"=",null===e&&(e=void 0),"object"===To(e)?Object.keys(e).map((function(r){var o=encodeURIComponent(ye(r))+t;return Array.isArray(e[r])?e[r].map((function(e){return o+encodeURIComponent(ye(e))})).join(n):o+encodeURIComponent(ye(e[r]))})).join(n):r?encodeURIComponent(ye(r))+t+encodeURIComponent(ye(e)):""},be=No((function(e,n){n.decode=n.parse=he,n.encode=n.stringify=we}));be.decode,be.parse,be.encode,be.stringify;for(var Ce=function(e){return"string"==typeof e&&(e=e.trim().replace(/^[?#&]/,"")),be.parse(e)},Ee=function(e){return e instanceof Error?e:new Error(e)},Ie=function(e){var n=e.error,t=e.message;try{n.message=t}catch(e){}},De=function(e){var n=e.error,t=e.message,r=Ee(n),o=t+"\nCaused by: "+r.message;return Ie({error:r,message:o}),r},Re=function(e){var n=e.getFullYear(),t=me(e.getMonth()+1,2,"0"),r=me(e.getDate(),2,"0"),o=me(e.getHours(),2,"0"),i=me(e.getMinutes(),2,"0"),a=me(e.getSeconds(),2,"0"),c=me(e.getMilliseconds(),3,"0"),u=e.getTimezoneOffset();return n+"-"+t+"-"+r+"T"+o+":"+i+":"+a+"."+c+(u>0?"-":"+")+me(Math.floor(Math.abs(u)/60),2,"0")+":"+me(Math.abs(u)%60,2,"0")},Se=No((function(e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var t=new Uint8Array(16);e.exports=function(){return n(t),t}}else{var r=new Array(16);e.exports=function(){for(var e,n=0;n<16;n++)0==(3&n)&&(e=4294967296*Math.random()),r[n]=e>>>((3&n)<<3)&255;return r}}})),ke=[],Oe=0;Oe<256;++Oe)ke[Oe]=(Oe+256).toString(16).substr(1);var Pe=function(e,n){var t=n||0,r=ke;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")},qe=function(e,n,t){var r=n&&t||0;"string"==typeof e&&(n="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||Se)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,n)for(var i=0;i<16;++i)n[r+i]=o[i];return n||Pe(o)},xe=function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t,r){return n(e(t,r),r)};return d(r,e,t),r},Ae=function(e,n,t){return xe(e,(function(e,t){return null==e?e:n(e,t)}),t)},Ne=function(e,n,t,r){if(!e)throw new Error("'"+t+"': Expected "+r+", but got "+JSON.stringify(n)+".")},Me=function(e,n){return Ne(function(e){return"boolean"==typeof e}(e),e,n,"true or false"),e},je=function(e,n){return Ne(N(e),e,n,"a function"),e},Te=function(e,n){return function(t,r){return Ne(t>=n,t,r,e+" greater than or equal to "+n),t}},Ue=function(e){return function(n,t){return m(n)?Ne(!fe(n),n,t,e):Ne(n.length>0,n,t,e),n}},Be=/^[a-z0-9.-]{1,}$/i,Fe=function(e,n){return Ne(Be.test(e),e,n,"a valid domain"),e},_e=function(e,n){return Ne(le(e),e,n,"an integer"),e},He=function(e,n){return Ne(de(e),e,n,"a number"),e},Ve=function(e,n){return Ne(function(e){try{return null!==new RegExp(e)}catch(e){return!1}}(e),e,n,"a regular expression"),e},Le=function(e,n){if(null==e)throw new Error("'"+n+"' is a required option");return e},ze=function(e,n){return Ne(ge(e),e,n,"a string"),e},We=function(e){return e};We.default=function(e){return xe(this,function(e){return function(n){return null==n?e:n}}(e))},We.required=function(){return xe(this,Le)};var Je=function(){return Ae(this,Fe)},Qe=function(e){return Ae(this,Te("an integer",e))},Xe=function(e){return Ae(this,Te("a number",e))},Ge=function(){return Ae(this,_e,{minimum:Qe})},$e=function(){return Ae(this,Ue("a non-empty string"))},Ke=function(){return Ae(this,Ue("a non-empty array"))},Ye=function(){return Ae(this,Ue("a non-empty object"))},Ze=function(){return Ae(this,Ve)},en=function(){return Ae(this,function(){var e=[];return function(n,t){return Ne(-1===e.indexOf(n),n,t,"a unique value across instances"),e.push(n),n}}())},nn=function(e,n){return xe(this,function(e,n){return function(t,r){var o=I(e,(function(e){try{return e(t,r),!0}catch(e){return!1}}));return Ne(o,t,r,n),t}}(e,n))}.bind(We),tn=function(){return Ae(this,We)}.bind(We),rn=function(e){return Ae(this,function(e){return function(n,t){Ne(Array.isArray(n),n,t,"an array");var r=[],o=n.map((function(n,o){try{return e(n,t+"["+o+"]")}catch(e){return void r.push(e.message)}}));if(r.length)throw new Error(r.join("\n"));return o}}(e),{nonEmpty:Ke})}.bind(We),on=function(){return Ae(this,Me)}.bind(We),an=function(){return Ae(this,je)}.bind(We),cn=function(e){return Ae(this,function(e){return function(n,t){return Ne(n===e,n,t,""+e),n}}(e))}.bind(We);(function(){return Ae(this,He,{minimum:Xe,integer:Ge,unique:en})}).bind(We);var un=function(e){return Ae(this,(n=e,function(e,t){Ne(m(e),e,t,"an object");var r=[],o={};if(Object.keys(e).forEach((function(i){var a=e[i],c=t?t+"."+i:i;try{var u=n(a,c);void 0!==u&&(o[i]=u)}catch(e){r.push(e.message)}})),r.length)throw new Error(r.join("\n"));return o}),{nonEmpty:Ye});var n}.bind(We),sn=function(e){return Ae(this,function(e){return function(n,t){Ne(m(n),n,t,"an object");var r=[],o={};if(Object.keys(e).forEach((function(i){var a=n[i],c=e[i],u=t?t+"."+i:i;try{var s=c(a,u);void 0!==s&&(o[i]=s)}catch(e){r.push(e.message)}})),Object.keys(n).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(o[e]=n[e])})),r.length)throw new Error(r.join("\n"));return o}}(e),{noUnknownFields:function(){return Ae(this,function(e){return function(n,t){var r=[];if(Object.keys(n).forEach((function(n){if(!e[n]){var o=t?t+"."+n:n;r.push("'"+o+"': Unknown field.")}})),r.length)throw new Error(r.join("\n"));return n}}(e))},nonEmpty:Ye})}.bind(We),fn=function(){return Ae(this,ze,{regexp:Ze,domain:Je,nonEmpty:$e,unique:en})}.bind(We),dn=function(){for(var e=arguments.length,n=new Array(e),t=0;t1&&void 0!==arguments[1]?arguments[1]:{},r=se(Object.keys(n),Object.keys(t));if(r.length)throw new Error("[ComponentRegistry] Could not register "+e+" because it has existing command(s): "+r.join(","));Object.keys(t).forEach((function(r){var o=t[r];o.commandName=r,o.run=mn(o.run,"["+e+"] An error occurred while executing the "+r+" command."),n[r]=o}))}(r,i),function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(n).forEach((function(r){t[r]=t[r]||[],t[r].push(mn(n[r],"["+e+"] An error occurred while executing the "+r+" lifecycle hook."))}))}(r,a),e[r]=o},getCommand:function(e){return n[e]},getCommandNames:function(){return Object.keys(n)},getLifecycleCallbacks:function(e){return t[e]||[]}}},yn="in",wn="pending",bn="general",Cn="declinedConsent",En="default",In="initial",Dn="new",Rn=function(e){var n=new Error(e);return n.code=Cn,n.message=e,n},Sn=function(e){var n=e.logger,t=[],r=function(){return Promise.resolve()},o=function(){return Promise.resolve()},i=function(){return Promise.reject(Rn("No consent preferences have been set."))},a=function(){return Promise.reject(Rn("The user declined consent."))},c=function(){var e=E();return t.push(e),e.promise};return{in:function(e){e===En?this.awaitConsent=r:(e===In?n.info("Loaded user consent preferences. The user previously consented."):e===Dn&&this.awaitConsent!==o&&n.info("User consented."),function(){for(;t.length;)t.shift().resolve()}(),this.awaitConsent=o)},out:function(e){e===En?(n.warn("User consent preferences not found. Default consent of out will be used."),this.awaitConsent=i):(e===In?n.warn("Loaded user consent preferences. The user previously declined consent."):e===Dn&&this.awaitConsent!==a&&n.warn("User declined consent."),function(){for(;t.length;)t.shift().reject(Rn("The user declined consent."))}(),this.awaitConsent=a)},pending:function(e){e===En&&n.info("User consent preferences not found. Default consent of pending will be used. Some commands may be delayed."),this.awaitConsent=c},awaitConsent:function(){return Promise.reject(new Error("Consent has not been initialized."))}}},kn=function(){var e,n,t={},r=!1,o=!1,i=!0,a=function(e){if(o)throw new Error(e+" cannot be called after event is finalized.")},c={setUserXdm:function(n){a("setUserXdm"),e=n},setUserData:function(e){a("setUserData"),n=e},mergeXdm:function(e){a("mergeXdm"),e&&y(t,{xdm:e})},mergeMeta:function(e){a("mergeMeta"),e&&y(t,{meta:e})},mergeQuery:function(e){a("mergeQuery"),e&&y(t,{query:e})},documentMayUnload:function(){r=!0},finalize:function(r){if(!o&&(e&&c.mergeXdm(e),n&&(t.data=n),o=!0,r)){i=!1;var a={xdm:t.xdm||{},data:t.data||{}},u=r(a);i=!1!==u,t.xdm=a.xdm||{},t.data=a.data||{},fe(t.xdm)&&delete t.xdm,fe(t.data)&&delete t.data}},getDocumentMayUnload:function(){return r},isEmpty:function(){return fe(t)&&(!e||fe(e))&&(!n||fe(n))},shouldSend:function(){return i},getViewName:function(){if(e&&e.web&&e.web.webPageDetails)return e.web.webPageDetails.viewName},toJSON:function(){if(!o)throw new Error("toJSON called before finalize");return t}};return c},On={CONFIGURE:"configure",SET_DEBUG:"setDebug"},Pn=function(e){var n,t=e.logger,r=e.configureCommand,o=e.setDebugCommand,i=e.handleError,a=e.validateCommandOptions,c=function(e,i){var c;if(e===On.CONFIGURE){if(n)throw new Error("The library has already been configured and may only be configured once.");c=function(){return(n=r(i)).then((function(){}))}}else{if(!n)throw new Error("The library must be configured first. Please do so by executing the configure command.");c=e===On.SET_DEBUG?function(){return o(i)}:function(){return n.then((function(n){var t,r=n.getCommand(e);if(!r||!N(r.run)){var o=(t=On,Object.keys(t).map((function(e){return t[e]}))).concat(n.getCommandNames()).join(", ");throw new Error("The "+e+" command does not exist. List of available commands: "+o+".")}var c=a({command:r,options:i});return r.run(c)}),(function(){return t.warn("An error during configuration is preventing the "+e+" command from executing."),new Promise((function(){}))}))}}return c};return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r){var o=c(e,n);t.logOnBeforeCommand({commandName:e,options:n}),r(o())})).catch((function(n){return i(n,e+" command")})).catch((function(r){throw t.logOnCommandRejected({commandName:e,options:n,error:r}),r})).then((function(r){var o=m(r)?r:{};return t.logOnCommandResolved({commandName:e,options:n,result:o}),o}))}},qn=function(e){var n=e.command,t=e.options,r=n.commandName,o=n.documentationUri,i=void 0===o?"https://adobe.ly/3sHgQHb":o,a=n.optionsValidator,c=t;if(a)try{c=a(t)}catch(e){throw new Error("Invalid "+r+" command options:\n\t - "+e+" For command documentation see: "+i)}return c},xn=function(e){var n=e.eventManager;return{commands:{sendEvent:{documentationUri:"https://adobe.ly/3GQ3Q7t",optionsValidator:function(e){return function(e){var n=e.options;return sn({type:fn(),xdm:sn({eventType:fn(),identityMap:ln}),data:sn({}),renderDecisions:on(),decisionScopes:rn(fn()),datasetId:fn()}).required()(n)}({options:e})},run:function(e){var t=e.xdm,r=e.data,o=e.documentUnloading,i=void 0!==o&&o,a=e.type,c=e.mergeId,u=e.renderDecisions,s=void 0!==u&&u,f=e.decisionScopes,d=void 0===f?[]:f,l=e.datasetId,g=n.createEvent();return i&&g.documentMayUnload(),g.setUserXdm(t),g.setUserData(r),a&&g.mergeXdm({eventType:a}),c&&g.mergeXdm({eventMergeId:c}),l&&g.mergeMeta({collect:{datasetId:l}}),n.sendEvent(g,{renderDecisions:s,decisionScopes:d})}},applyEvents:{documentationUri:"",optionsValidator:function(e){return function(e){var n=e.options;return sn({renderDecisions:on(),request:sn({headers:tn().required(),body:tn().required()}).required(),response:sn({headers:tn().required(),body:tn().required()}).required()})(n)}({options:e})},run:function(e){var t=e.request,r=void 0===t?{}:t,o=e.renderDecisions,i=void 0!==o&&o,a=r.body.events,c=void 0===a?[]:a;return Promise.all(c.map((function(t){var r=n.createEvent(),o=t.xdm,a=void 0===o?{}:o,c=t.query,u=void 0===c?{personalization:{decisionScopes:[]}}:c,s=t.data,f=void 0===s?{}:s,d=u.personalization.decisionScopes;return r.setUserXdm(a),r.setUserData(f),n.sendEvent(r,{renderDecisions:i,decisionScopes:d,serverState:e})})))}}}}};xn.namespace="DataCollector",xn.configValidators={};var An=function(e){var n=e.config,t=e.eventManager,r=e.lifecycle,o=e.handleError;if(n.clickCollectionEnabled){var i=function(e){var n=e.eventManager,t=e.lifecycle,r=e.handleError;return function(e){var o=e.target,i=n.createEvent();return t.onClick({event:i,clickedElement:o}).then((function(){return i.isEmpty()?Promise.resolve():n.sendEvent(i)})).then(ve).catch((function(e){r(e,"click collection")}))}}({eventManager:t,lifecycle:r,handleError:o});document.addEventListener("click",i,!0)}},Nn={clickCollectionEnabled:on().default(!0),downloadLinkQualifier:fn().regexp().default("\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$")},Mn=function(e,n,t,r){var o="other";return!function(e,n,t){var r=new RegExp(e);return!!t.download||r.test(n.toLowerCase())}(n.downloadLinkQualifier,t,r)?function(e,n){var t=e.location.hostname.toLowerCase();return!(n.toLowerCase().indexOf(t)>=0)}(e,t)&&(o="exit"):o="download",o},jn=function(e){var n=e.config,t=e.eventManager,r=e.handleError,o=function(e,n){return function(t,r){var o=function(e){for(var n,t=e;t;){if((n=t).href&&("A"===n.tagName||"AREA"===n.tagName)&&(!n.onclick||!n.protocol||n.protocol.toLowerCase().indexOf("javascript")<0))return t;t=t.parentNode}return null}(r);if(o){var i=function(e,n){var t=e.location,r=n.href?n.href:"",o=n.protocol,i=n.host;if(!function(e){return e&&/^[a-z0-9]+:\/\//i.test(e)}(r)){o||(o=t.protocol?t.protocol:""),o=o?o+"//":"",i||(i=t.host?t.host:"");var a="";if("/"!==r.substring(0,1)){var c=t.pathname.lastIndexOf("/");c=c<0?0:c,a=t.pathname.substring(0,c)}r=""+o+i+a+"/"+r}return r}(e,o);if(i){var a=Mn(e,n,i,o);t.documentMayUnload(),t.mergeXdm({eventType:"web.webinteraction.linkClicks",web:{webInteraction:{name:"Link Click",type:a,URL:i,linkClicks:{value:1}}}})}}}}(window,n);return{lifecycle:{onComponentsRegistered:function(e){var o=e.lifecycle;An({config:n,eventManager:t,lifecycle:o,handleError:r})},onClick:function(e){var n=e.event,t=e.clickedElement;o(n,t)}}}};jn.namespace="ActivityCollector",jn.configValidators=Nn;var Tn,Un,Bn,Fn=function(e,n){return"ID sync "+(n?"succeeded":"failed")+": "+e.spec.url},_n={thirdPartyCookiesEnabled:on().default(!0),idMigrationEnabled:on().default(!0)},Hn=function(e){return sn({namespaces:rn(cn("ECID")).nonEmpty()}).noUnknownFields()(e),{namespaces:["ECID"]}},Vn=oe(window,p),Ln=function(e){var n=e.config,t=e.getEcidFromVisitor,r=n.idMigrationEnabled,o="AMCV_"+n.orgId;return{getEcid:function(){if(r){var e=function(){var e=null,n=p.get("s_ecid")||p.get(o);if(n){var t=n.match(/(^|\|)MCMID\|(\d+)($|\|)/);t&&(e=t[2])}return e}();return e?Promise.resolve(e):t()}return Promise.resolve()},setEcid:function(e){r&&!p.get(o)&&p.set(o,"MCMID|"+e,{domain:Vn,expires:390})}}},zn=function(e){var n=e.logger;return new Promise((function(e,t){if(m(window.adobe)&&m(window.adobe.optIn)){var r=window.adobe.optIn;n.info("Delaying request while waiting for legacy opt-in to let Visitor retrieve ECID from server."),r.fetchPermissions((function(){r.isApproved([r.Categories.ECID])?(n.info("Received legacy opt-in approval to let Visitor retrieve ECID from server."),e()):t(new Error("Legacy opt-in was declined."))}),!0)}else e()}))},Wn=function(e){var n=e.logger,t=e.orgId,r=e.awaitVisitorOptIn,o=function(e){var n=e.Visitor;return N(n)&&N(n.getInstance)&&n}(window);return function(){return o?r({logger:n}).then((function(){return n.info("Delaying request while using Visitor to retrieve ECID from server."),new Promise((function(e){o.getInstance(t,{}).getMarketingCloudVisitorID((function(t){n.info("Resuming previously delayed request that was waiting for ECID from Visitor."),e(t)}),!0)}))})).catch((function(e){e?n.info(e.message+", retrieving ECID from experience edge"):n.info("An error occurred while obtaining the ECID from Visitor.")})):Promise.resolve()}},Jn="ECID",Qn=function(e){e.mergeQuery({identity:{fetch:[Jn]}})},Xn=(Tn=function(o){var i,a;return(Uo(i={},n,/Edge\/([0-9\._]+)/),Uo(i,t,/Edg\/([0-9\.]+)/),Uo(i,e,/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/),Uo(i,"Firefox",/Firefox\/([0-9\.]+)(?:\s|$)/),Uo(i,"IE",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/),Uo(i,"Safari",/Version\/([0-9\._]+).*Safari/),a=i,function(e){for(var n=Object.keys(a),t=0;t0},hasViewName:function(){return pe(a)},createQueryDetails:function(){var e=_o(t);this.isCacheInitialized()||o(e,ft)||e.push(ft);var n=[dt,"https://ns.adobe.com/personalization/html-content-item","https://ns.adobe.com/personalization/json-content-item",gt];return o(e,ft)&&n.push(lt),{schemas:n,decisionScopes:e}},isCacheInitialized:function(){return i.isInitialized()},shouldFetchData:function(){return this.hasScopes()||!this.isCacheInitialized()},shouldUseCachedData:function(){return this.hasViewName()&&this.isCacheInitialized()}}}({renderDecisions:f,decisionScopes:l,event:i,viewCache:u});if(h.shouldFetchData()){var y=E();return u.storeViews(y.promise),m((function(){return y.reject()})),void t({decisionsDeferred:y,personalizationDetails:h,event:i,onResponse:p})}return h.shouldUseCachedData()?r({personalizationDetails:h,event:i,onResponse:p,onRequestFailure:m}):void 0},onClick:function(e){var n=e.event,t=e.clickedElement;i({event:n,clickedElement:t})}}}},vt=function(e){return S("DIV",{},{innerHTML:e})},mt=No((function(e,n){var t;t=l,e.exports=function(e){if(e.CSS&&e.CSS.escape)return e.CSS.escape;var n=function(e){if(0==arguments.length)throw new TypeError("`CSS.escape` requires an argument.");for(var n,t=String(e),r=t.length,o=-1,i="",a=t.charCodeAt(0);++o=1&&n<=31||127==n||0==o&&n>=48&&n<=57||1==o&&n>=48&&n<=57&&45==a?"\\"+n.toString(16)+" ":0==o&&1==r&&45==n||!(n>=128||45==n||95==n||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122)?"\\"+t.charAt(o):t.charAt(o):i+="�";return i};return e.CSS||(e.CSS={}),e.CSS.escape=n,n}(t)})),ht=/:eq\((\d+)\)/g,yt=function(e){return-1===e.indexOf(":eq(")},wt=/(#|\.)(-?\w+)/g,bt=/^\s*>?\s*/,Ct=function(e,n,t){return""+n+mt(t)},Et=function(e){for(var n=[],t=function(e){return e.split(ht).filter(pe)}(function(e){return e.replace(wt,Ct)}(e.trim())),r=t.length,o=0;od-1)break;if(a1&&void 0!==arguments[1]?arguments[1]:document;return n.getElementById(e)},Rt=function(e,n,t){e.setAttribute(n,t)},St=function(e,n){return e.getAttribute(n)},kt=function(e){return e.parentNode},Ot=function(e,n){if(e){var t=kt(e);t&&t.insertBefore(n,function(e){return e.nextElementSibling}(e))}},Pt=function(e,n){if(e){var t=kt(e);t&&t.insertBefore(n,e)}},qt=function(e){var n=e.childNodes;return n?j(n):[]},xt=function(e){return e.firstElementChild},At=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;if(void 0===st){var n=e.querySelector("[nonce]");st=n&&(n.nonce||n.getAttribute("nonce"))}return st},Nt="alloy-prehiding",Mt={},jt=function(e){var n=Mt[e];n&&(Y(n),delete Mt[e])},Tt=function(e){if(e&&!Dt(Nt)){var n=At(),t=jo({id:Nt},n&&{nonce:n}),r=S(q,t,{textContent:e});D(document.head,r)}},Ut=function(){var e=Dt(Nt);e&&Y(e)},Bt=function(e,n){e.textContent=n},Ft="src",_t=function(e){return S(P,{src:e})},Ht=function(e){V(P,e).forEach((function(e){var n=St(e,Ft);n&&_t(n)}))},Vt=function(e){return function(e,n){return e.tagName===n}(e,q)&&!St(e,Ft)},Lt=function(e){var n=V(q,e),t=n.length,r=At();if(r)for(var o=0;o=0;){var c=r[a],u=xt(e);u?Pt(u,c):D(e,c),a-=1}return er(e,o),nr(i)},ir=function(e,n){var t=vt(n);Lt(t);var r=qt(t),o=Yt(t),i=Zt(t);return Ht(t),r.forEach((function(n){Pt(e,n)})),er(e,o),nr(i)},ar=function(e,n){ir(e,n),Y(e)},cr=function(e,n){var t=vt(n);Lt(t);var r=qt(t),o=Yt(t),i=Zt(t);return Ht(t),r.forEach((function(n){Ot(e,n)})),er(e,o),nr(i)},ur=["priority"],sr=function(e,n){var t=n.priority,r=Bo(n,ur);Object.keys(r).forEach((function(n){!function(e,n,t,r){var o;o=r?n+":"+t+" !"+r+";":n+":"+t+";",e.style.cssText+=";"+o}(e,n,r[n],t)}))},fr=function(e,n){Object.keys(n).forEach((function(t){Rt(e,t,n[t])}))},dr=function(e,n){e.tagName===P&&(_t(n),function(e,n){e.removeAttribute(n)}(e,Ft),Rt(e,Ft,n))},lr=function(e,n){var t=n.from,r=n.to,o=function(e){var n=e.children;return n?j(n):[]}(e),i=o[t],a=o[r];i&&a&&(t