{"version":3,"sources":["../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/regex.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/validate.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v1.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/parse.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v35.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/md5.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v3.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v4.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/sha1.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v5.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/nil.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/version.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/index.js","../../../node_modules/.pnpm/@lukeed+uuid@2.0.0/node_modules/@lukeed/uuid/dist/index.js","../../../node_modules/.pnpm/@ndhoule+keys@2.0.0/node_modules/@ndhoule/keys/index.js","../../../node_modules/.pnpm/@segment+localstorage-retry@1.3.0/node_modules/@segment/localstorage-retry/lib/engine.js","../../../node_modules/.pnpm/@ndhoule+each@2.0.1/node_modules/@ndhoule/each/index.js","../../../node_modules/.pnpm/@segment+localstorage-retry@1.3.0/node_modules/@segment/localstorage-retry/lib/store.js","../../../node_modules/.pnpm/@segment+localstorage-retry@1.3.0/node_modules/@segment/localstorage-retry/lib/schedule.js","../../../node_modules/.pnpm/debug@0.7.4/node_modules/debug/debug.js","../../../node_modules/.pnpm/component-emitter@1.3.0/node_modules/component-emitter/index.js","../../../node_modules/.pnpm/@segment+localstorage-retry@1.3.0/node_modules/@segment/localstorage-retry/lib/index.js","../../types/dist/enums.js","../../types/dist/payload.js","../../types/dist/psm.js","../../types/dist/telemetry.js","../../types/dist/index.js","../src/utils/constants.ts","../src/common/Core.ts","../src/web/identity.ts","../../../node_modules/.pnpm/component-url@0.2.1/node_modules/component-url/index.js","../../../node_modules/.pnpm/ms@2.0.0/node_modules/ms/index.js","../../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/debug.js","../../../node_modules/.pnpm/debug@2.6.9/node_modules/debug/src/browser.js","../../../node_modules/.pnpm/component-cookie@1.1.5/node_modules/component-cookie/index.js","../../../node_modules/.pnpm/@segment+top-domain@3.0.1/node_modules/@segment/top-domain/lib/index.js","../../cookie/src/index.ts","../../cookie/src/helper.ts","../src/utils/browser.ts","../src/utils/logger.ts","../src/utils/sendRequest.ts","../src/web/USPrivacyString.ts","../src/web/privacy.ts","../src/utils/hydratePayload.ts","../src/web/dependencies.ts","../src/web/Psm.ts","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/fails.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/function-bind-native.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/function-uncurry-this.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/classof-raw.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/indexed-object.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/require-object-coercible.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-indexed-object.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/global.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/is-pure.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/define-global-property.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/shared-store.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/shared.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-object.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/has-own-property.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/uid.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/is-callable.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/get-built-in.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/engine-user-agent.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/engine-v8-version.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/native-symbol.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/use-symbol-as-uid.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/well-known-symbol.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/is-object.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/an-object.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/descriptors.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/v8-prototype-define-bug.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/document-create-element.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/ie8-dom-define.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/function-call.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-is-prototype-of.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/is-symbol.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/try-to-string.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/a-callable.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/get-method.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/ordinary-to-primitive.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-primitive.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-property-key.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-define-property.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/math-trunc.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-integer-or-infinity.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-absolute-index.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/to-length.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/length-of-array-like.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/array-includes.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/hidden-keys.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-keys-internal.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/enum-bug-keys.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-keys.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-define-properties.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/html.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/shared-key.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-create.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/add-to-unscopables.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/iterators.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/inspect-source.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/native-weak-map.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/create-property-descriptor.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/create-non-enumerable-property.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/internal-state.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-property-is-enumerable.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-get-own-property-descriptor.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/function-name.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/make-built-in.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/define-built-in.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-get-own-property-names.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-get-own-property-symbols.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/own-keys.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/copy-constructor-properties.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/is-forced.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/export.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/correct-prototype-getter.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-get-prototype-of.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/iterators-core.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/set-to-string-tag.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/create-iterator-constructor.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/a-possible-prototype.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/object-set-prototype-of.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/internals/define-iterator.js","../../../node_modules/.pnpm/core-js@3.23.4/node_modules/core-js/modules/es.array.iterator.js","../../utils/src/global-helper.ts","../../utils/src/cookie-helper.ts","../../utils/src/dates.ts","../../../node_modules/.pnpm/unfetch@4.2.0/node_modules/unfetch/src/index.mjs","../../utils/src/http-helper.ts","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/regex.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/validate.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v4.js","../../utils/src/ids.ts","../../utils/src/location-helper.ts","../../utils/src/logger.ts","../../feature-flag-client/src/config/constants.ts","../../feature-flag-client/src/featureFlagStorage.ts","../../feature-flag-client/src/polyfills.ts","../../feature-flag-client/src/utils/Sha256.ts","../../feature-flag-client/src/featureFlagClient.ts","../src/web/payloadCore.ts","../src/utils/payloadBuilder.ts","../src/utils/processQueue.ts","../src/common/psm.ts","../../prism-module-telemetry/src/common/constants.ts","../src/web/index.ts"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js'; // **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || new Array(16);\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || rng)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n var msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || stringify(b);\n}\n\nexport default v1;","import validate from './validate.js';\n\nfunction parse(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n var v;\n var arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nexport default parse;","import stringify from './stringify.js';\nimport parse from './parse.js';\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = [];\n\n for (var i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nexport var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexport var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexport default function (name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = parse(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n var bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return stringify(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","/*\n * Browser-compatible JavaScript MD5\n *\n * Modification of JavaScript MD5\n * https://github.com/blueimp/JavaScript-MD5\n *\n * Copyright 2011, Sebastian Tschan\n * https://blueimp.net\n *\n * Licensed under the MIT license:\n * https://opensource.org/licenses/MIT\n *\n * Based on\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\nfunction md5(bytes) {\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = new Uint8Array(msg.length);\n\n for (var i = 0; i < msg.length; ++i) {\n bytes[i] = msg.charCodeAt(i);\n }\n }\n\n return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));\n}\n/*\n * Convert an array of little-endian words to an array of bytes\n */\n\n\nfunction md5ToHexEncodedArray(input) {\n var output = [];\n var length32 = input.length * 32;\n var hexTab = '0123456789abcdef';\n\n for (var i = 0; i < length32; i += 8) {\n var x = input[i >> 5] >>> i % 32 & 0xff;\n var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);\n output.push(hex);\n }\n\n return output;\n}\n/**\n * Calculate output length with padding and bit length\n */\n\n\nfunction getOutputLength(inputLength8) {\n return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;\n}\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length.\n */\n\n\nfunction wordsToMd5(x, len) {\n /* append padding */\n x[len >> 5] |= 0x80 << len % 32;\n x[getOutputLength(len) - 1] = len;\n var a = 1732584193;\n var b = -271733879;\n var c = -1732584194;\n var d = 271733878;\n\n for (var i = 0; i < x.length; i += 16) {\n var olda = a;\n var oldb = b;\n var oldc = c;\n var oldd = d;\n a = md5ff(a, b, c, d, x[i], 7, -680876936);\n d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);\n c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);\n b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);\n a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);\n d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);\n c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);\n b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);\n a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);\n d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);\n c = md5ff(c, d, a, b, x[i + 10], 17, -42063);\n b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);\n a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);\n d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);\n c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);\n b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);\n a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);\n d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);\n c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);\n b = md5gg(b, c, d, a, x[i], 20, -373897302);\n a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);\n d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);\n c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);\n b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);\n a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);\n d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);\n c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);\n b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);\n a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);\n d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);\n c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);\n b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);\n a = md5hh(a, b, c, d, x[i + 5], 4, -378558);\n d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);\n c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);\n b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);\n a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);\n d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);\n c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);\n b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);\n a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);\n d = md5hh(d, a, b, c, x[i], 11, -358537222);\n c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);\n b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);\n a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);\n d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);\n c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);\n b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);\n a = md5ii(a, b, c, d, x[i], 6, -198630844);\n d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);\n c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);\n b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);\n a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);\n d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);\n c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);\n b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);\n a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);\n d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);\n c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);\n b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);\n a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);\n d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);\n c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);\n b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);\n a = safeAdd(a, olda);\n b = safeAdd(b, oldb);\n c = safeAdd(c, oldc);\n d = safeAdd(d, oldd);\n }\n\n return [a, b, c, d];\n}\n/*\n * Convert an array bytes to an array of little-endian words\n * Characters >255 have their high-byte silently ignored.\n */\n\n\nfunction bytesToWords(input) {\n if (input.length === 0) {\n return [];\n }\n\n var length8 = input.length * 8;\n var output = new Uint32Array(getOutputLength(length8));\n\n for (var i = 0; i < length8; i += 8) {\n output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;\n }\n\n return output;\n}\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\n\n\nfunction safeAdd(x, y) {\n var lsw = (x & 0xffff) + (y & 0xffff);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return msw << 16 | lsw & 0xffff;\n}\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\n\n\nfunction bitRotateLeft(num, cnt) {\n return num << cnt | num >>> 32 - cnt;\n}\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\n\n\nfunction md5cmn(q, a, b, x, s, t) {\n return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);\n}\n\nfunction md5ff(a, b, c, d, x, s, t) {\n return md5cmn(b & c | ~b & d, a, b, x, s, t);\n}\n\nfunction md5gg(a, b, c, d, x, s, t) {\n return md5cmn(b & d | c & ~d, a, b, x, s, t);\n}\n\nfunction md5hh(a, b, c, d, x, s, t) {\n return md5cmn(b ^ c ^ d, a, b, x, s, t);\n}\n\nfunction md5ii(a, b, c, d, x, s, t) {\n return md5cmn(c ^ (b | ~d), a, b, x, s, t);\n}\n\nexport default md5;","import v35 from './v35.js';\nimport md5 from './md5.js';\nvar v3 = v35('v3', 0x30, md5);\nexport default v3;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","// Adapted from Chris Veness' SHA1 code at\n// http://www.movable-type.co.uk/scripts/sha1.html\nfunction f(s, x, y, z) {\n switch (s) {\n case 0:\n return x & y ^ ~x & z;\n\n case 1:\n return x ^ y ^ z;\n\n case 2:\n return x & y ^ x & z ^ y & z;\n\n case 3:\n return x ^ y ^ z;\n }\n}\n\nfunction ROTL(x, n) {\n return x << n | x >>> 32 - n;\n}\n\nfunction sha1(bytes) {\n var K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];\n var H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];\n\n if (typeof bytes === 'string') {\n var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape\n\n bytes = [];\n\n for (var i = 0; i < msg.length; ++i) {\n bytes.push(msg.charCodeAt(i));\n }\n } else if (!Array.isArray(bytes)) {\n // Convert Array-like to Array\n bytes = Array.prototype.slice.call(bytes);\n }\n\n bytes.push(0x80);\n var l = bytes.length / 4 + 2;\n var N = Math.ceil(l / 16);\n var M = new Array(N);\n\n for (var _i = 0; _i < N; ++_i) {\n var arr = new Uint32Array(16);\n\n for (var j = 0; j < 16; ++j) {\n arr[j] = bytes[_i * 64 + j * 4] << 24 | bytes[_i * 64 + j * 4 + 1] << 16 | bytes[_i * 64 + j * 4 + 2] << 8 | bytes[_i * 64 + j * 4 + 3];\n }\n\n M[_i] = arr;\n }\n\n M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);\n M[N - 1][14] = Math.floor(M[N - 1][14]);\n M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;\n\n for (var _i2 = 0; _i2 < N; ++_i2) {\n var W = new Uint32Array(80);\n\n for (var t = 0; t < 16; ++t) {\n W[t] = M[_i2][t];\n }\n\n for (var _t = 16; _t < 80; ++_t) {\n W[_t] = ROTL(W[_t - 3] ^ W[_t - 8] ^ W[_t - 14] ^ W[_t - 16], 1);\n }\n\n var a = H[0];\n var b = H[1];\n var c = H[2];\n var d = H[3];\n var e = H[4];\n\n for (var _t2 = 0; _t2 < 80; ++_t2) {\n var s = Math.floor(_t2 / 20);\n var T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[_t2] >>> 0;\n e = d;\n d = c;\n c = ROTL(b, 30) >>> 0;\n b = a;\n a = T;\n }\n\n H[0] = H[0] + a >>> 0;\n H[1] = H[1] + b >>> 0;\n H[2] = H[2] + c >>> 0;\n H[3] = H[3] + d >>> 0;\n H[4] = H[4] + e >>> 0;\n }\n\n return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];\n}\n\nexport default sha1;","import v35 from './v35.js';\nimport sha1 from './sha1.js';\nvar v5 = v35('v5', 0x50, sha1);\nexport default v5;","export default '00000000-0000-0000-0000-000000000000';","import validate from './validate.js';\n\nfunction version(uuid) {\n if (!validate(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nexport default version;","export { default as v1 } from './v1.js';\nexport { default as v3 } from './v3.js';\nexport { default as v4 } from './v4.js';\nexport { default as v5 } from './v5.js';\nexport { default as NIL } from './nil.js';\nexport { default as version } from './version.js';\nexport { default as validate } from './validate.js';\nexport { default as stringify } from './stringify.js';\nexport { default as parse } from './parse.js';","var IDX=256, HEX=[], BUFFER;\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nfunction v4() {\n\tvar i=0, num, out='';\n\n\tif (!BUFFER || ((IDX + 16) > 256)) {\n\t\tBUFFER = Array(i=256);\n\t\twhile (i--) BUFFER[i] = 256 * Math.random() | 0;\n\t\ti = IDX = 0;\n\t}\n\n\tfor (; i < 16; i++) {\n\t\tnum = BUFFER[IDX + i];\n\t\tif (i==6) out += HEX[num & 15 | 64];\n\t\telse if (i==8) out += HEX[num & 63 | 128];\n\t\telse out += HEX[num];\n\n\t\tif (i & 1 && i > 1 && i < 11) out += '-';\n\t}\n\n\tIDX++;\n\treturn out;\n}\n\nexports.v4 = v4;","'use strict';\n\nvar hop = Object.prototype.hasOwnProperty;\nvar strCharAt = String.prototype.charAt;\nvar toStr = Object.prototype.toString;\n\n/**\n * Returns the character at a given index.\n *\n * @param {string} str\n * @param {number} index\n * @return {string|undefined}\n */\n// TODO: Move to a library\nvar charAt = function(str, index) {\n return strCharAt.call(str, index);\n};\n\n/**\n * hasOwnProperty, wrapped as a function.\n *\n * @name has\n * @api private\n * @param {*} context\n * @param {string|number} prop\n * @return {boolean}\n */\n\n// TODO: Move to a library\nvar has = function has(context, prop) {\n return hop.call(context, prop);\n};\n\n/**\n * Returns true if a value is a string, otherwise false.\n *\n * @name isString\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n\n// TODO: Move to a library\nvar isString = function isString(val) {\n return toStr.call(val) === '[object String]';\n};\n\n/**\n * Returns true if a value is array-like, otherwise false. Array-like means a\n * value is not null, undefined, or a function, and has a numeric `length`\n * property.\n *\n * @name isArrayLike\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isArrayLike = function isArrayLike(val) {\n return val != null && (typeof val !== 'function' && typeof val.length === 'number');\n};\n\n\n/**\n * indexKeys\n *\n * @name indexKeys\n * @api private\n * @param {} target\n * @param {Function} pred\n * @return {Array}\n */\nvar indexKeys = function indexKeys(target, pred) {\n pred = pred || has;\n\n var results = [];\n\n for (var i = 0, len = target.length; i < len; i += 1) {\n if (pred(target, i)) {\n results.push(String(i));\n }\n }\n\n return results;\n};\n\n/**\n * Returns an array of an object's owned keys.\n *\n * @name objectKeys\n * @api private\n * @param {*} target\n * @param {Function} pred Predicate function used to include/exclude values from\n * the resulting array.\n * @return {Array}\n */\nvar objectKeys = function objectKeys(target, pred) {\n pred = pred || has;\n\n var results = [];\n\n for (var key in target) {\n if (pred(target, key)) {\n results.push(String(key));\n }\n }\n\n return results;\n};\n\n/**\n * Creates an array composed of all keys on the input object. Ignores any non-enumerable properties.\n * More permissive than the native `Object.keys` function (non-objects will not throw errors).\n *\n * @name keys\n * @api public\n * @category Object\n * @param {Object} source The value to retrieve keys from.\n * @return {Array} An array containing all the input `source`'s keys.\n * @example\n * keys({ likes: 'avocado', hates: 'pineapple' });\n * //=> ['likes', 'pineapple'];\n *\n * // Ignores non-enumerable properties\n * var hasHiddenKey = { name: 'Tim' };\n * Object.defineProperty(hasHiddenKey, 'hidden', {\n * value: 'i am not enumerable!',\n * enumerable: false\n * })\n * keys(hasHiddenKey);\n * //=> ['name'];\n *\n * // Works on arrays\n * keys(['a', 'b', 'c']);\n * //=> ['0', '1', '2']\n *\n * // Skips unpopulated indices in sparse arrays\n * var arr = [1];\n * arr[4] = 4;\n * keys(arr);\n * //=> ['0', '4']\n */\nvar keys = function keys(source) {\n if (source == null) {\n return [];\n }\n\n // IE6-8 compatibility (string)\n if (isString(source)) {\n return indexKeys(source, charAt);\n }\n\n // IE6-8 compatibility (arguments)\n if (isArrayLike(source)) {\n return indexKeys(source, has);\n }\n\n return objectKeys(source);\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = keys;\n","'use strict';\n\nvar keys = require('@ndhoule/keys');\nvar uuid = require('uuid').v4;\n\nvar inMemoryStore = {\n _data: {},\n length: 0,\n setItem: function(key, value) {\n this._data[key] = value;\n this.length = keys(this._data).length;\n return value;\n },\n getItem: function(key) {\n if (key in this._data) {\n return this._data[key];\n }\n return null;\n },\n removeItem: function(key) {\n if (key in this._data) {\n delete this._data[key];\n }\n this.length = keys(this._data).length;\n return null;\n },\n clear: function() {\n this._data = {};\n this.length = 0;\n },\n key: function(index) {\n return keys(this._data)[index];\n }\n};\n\nfunction isSupportedNatively() {\n try {\n if (!window.localStorage) return false;\n var key = uuid();\n window.localStorage.setItem(key, 'test_value');\n var value = window.localStorage.getItem(key);\n window.localStorage.removeItem(key);\n\n // handle localStorage silently failing\n return value === 'test_value';\n } catch (e) {\n // Can throw if localStorage is disabled\n return false;\n }\n}\n\nfunction pickStorage() {\n if (isSupportedNatively()) {\n return window.localStorage;\n }\n // fall back to in-memory\n return inMemoryStore;\n}\n\n// Return a shared instance\nmodule.exports.defaultEngine = pickStorage();\n// Expose the in-memory store explicitly for testing\nmodule.exports.inMemoryEngine = inMemoryStore;\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar keys = require('@ndhoule/keys');\n\nvar objToString = Object.prototype.toString;\n\n/**\n * Tests if a value is a number.\n *\n * @name isNumber\n * @api private\n * @param {*} val The value to test.\n * @return {boolean} Returns `true` if `val` is a number, otherwise `false`.\n */\n// TODO: Move to library\nvar isNumber = function isNumber(val) {\n var type = typeof val;\n return type === 'number' || (type === 'object' && objToString.call(val) === '[object Number]');\n};\n\n/**\n * Tests if a value is an array.\n *\n * @name isArray\n * @api private\n * @param {*} val The value to test.\n * @return {boolean} Returns `true` if the value is an array, otherwise `false`.\n */\n// TODO: Move to library\nvar isArray = typeof Array.isArray === 'function' ? Array.isArray : function isArray(val) {\n return objToString.call(val) === '[object Array]';\n};\n\n/**\n * Tests if a value is array-like. Array-like means the value is not a function and has a numeric\n * `.length` property.\n *\n * @name isArrayLike\n * @api private\n * @param {*} val\n * @return {boolean}\n */\n// TODO: Move to library\nvar isArrayLike = function isArrayLike(val) {\n return val != null && (isArray(val) || (val !== 'function' && isNumber(val.length)));\n};\n\n/**\n * Internal implementation of `each`. Works on arrays and array-like data structures.\n *\n * @name arrayEach\n * @api private\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Array} array The array(-like) structure to iterate over.\n * @return {undefined}\n */\nvar arrayEach = function arrayEach(iterator, array) {\n for (var i = 0; i < array.length; i += 1) {\n // Break iteration early if `iterator` returns `false`\n if (iterator(array[i], i, array) === false) {\n break;\n }\n }\n};\n\n/**\n * Internal implementation of `each`. Works on objects.\n *\n * @name baseEach\n * @api private\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Object} object The object to iterate over.\n * @return {undefined}\n */\nvar baseEach = function baseEach(iterator, object) {\n var ks = keys(object);\n\n for (var i = 0; i < ks.length; i += 1) {\n // Break iteration early if `iterator` returns `false`\n if (iterator(object[ks[i]], ks[i], object) === false) {\n break;\n }\n }\n};\n\n/**\n * Iterate over an input collection, invoking an `iterator` function for each element in the\n * collection and passing to it three arguments: `(value, index, collection)`. The `iterator`\n * function can end iteration early by returning `false`.\n *\n * @name each\n * @api public\n * @param {Function(value, key, collection)} iterator The function to invoke per iteration.\n * @param {Array|Object|string} collection The collection to iterate over.\n * @return {undefined} Because `each` is run only for side effects, always returns `undefined`.\n * @example\n * var log = console.log.bind(console);\n *\n * each(log, ['a', 'b', 'c']);\n * //-> 'a', 0, ['a', 'b', 'c']\n * //-> 'b', 1, ['a', 'b', 'c']\n * //-> 'c', 2, ['a', 'b', 'c']\n * //=> undefined\n *\n * each(log, 'tim');\n * //-> 't', 2, 'tim'\n * //-> 'i', 1, 'tim'\n * //-> 'm', 0, 'tim'\n * //=> undefined\n *\n * // Note: Iteration order not guaranteed across environments\n * each(log, { name: 'tim', occupation: 'enchanter' });\n * //-> 'tim', 'name', { name: 'tim', occupation: 'enchanter' }\n * //-> 'enchanter', 'occupation', { name: 'tim', occupation: 'enchanter' }\n * //=> undefined\n */\nvar each = function each(iterator, collection) {\n return (isArrayLike(collection) ? arrayEach : baseEach).call(this, iterator, collection);\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = each;\n","'use strict';\n\nvar defaultEngine = require('./engine').defaultEngine;\nvar inMemoryEngine = require('./engine').inMemoryEngine;\nvar each = require('@ndhoule/each');\nvar keys = require('@ndhoule/keys');\nvar json = JSON;\n\n/**\n* Store Implementation with dedicated\n*/\n\nfunction Store(name, id, keys, optionalEngine) {\n this.id = id;\n this.name = name;\n this.keys = keys || {};\n this.engine = optionalEngine || defaultEngine;\n this.originalEngine = this.engine;\n}\n\n/**\n* Set value by key.\n*/\n\nStore.prototype.set = function(key, value) {\n var compoundKey = this._createValidKey(key);\n if (!compoundKey) return;\n try {\n this.engine.setItem(compoundKey, json.stringify(value));\n } catch (err) {\n if (isQuotaExceeded(err)) {\n // switch to inMemory engine\n this._swapEngine();\n // and save it there\n this.set(key, value);\n }\n }\n};\n\n/**\n* Get by Key.\n*/\n\nStore.prototype.get = function(key) {\n try {\n var str = this.engine.getItem(this._createValidKey(key));\n if (str === null) {\n return null;\n }\n return json.parse(str);\n } catch (err) {\n return null;\n }\n};\n\n/**\n * Get original engine\n */\n\nStore.prototype.getOriginalEngine = function() {\n return this.originalEngine;\n};\n\n/**\n* Remove by Key.\n*/\n\nStore.prototype.remove = function(key) {\n this.engine.removeItem(this._createValidKey(key));\n};\n\n/**\n* Ensure the key is valid\n*/\n\nStore.prototype._createValidKey = function(key) {\n var name = this.name;\n var id = this.id;\n\n if (!keys(this.keys).length) return [name, id, key].join('.');\n\n // validate and return undefined if invalid key\n var compoundKey;\n each(function(value) {\n if (value === key) {\n compoundKey = [name, id, key].join('.');\n }\n }, this.keys);\n return compoundKey;\n};\n\n/**\n* Switch to inMemoryEngine, bringing any existing data with.\n*/\n\nStore.prototype._swapEngine = function() {\n var self = this;\n\n // grab existing data, but only for this page's queue instance, not all\n // better to keep other queues in localstorage to be flushed later\n // than to pull them into memory and remove them from durable storage\n each(function(key) {\n var value = self.get(key);\n inMemoryEngine.setItem([self.name, self.id, key].join('.'), value);\n self.remove(key);\n }, this.keys);\n\n this.engine = inMemoryEngine;\n};\n\nmodule.exports = Store;\n\nfunction isQuotaExceeded(e) {\n var quotaExceeded = false;\n if (e.code) {\n switch (e.code) {\n case 22:\n quotaExceeded = true;\n break;\n case 1014:\n // Firefox\n if (e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n quotaExceeded = true;\n }\n break;\n default:\n break;\n }\n } else if (e.number === -2147024882) {\n // Internet Explorer 8\n quotaExceeded = true;\n }\n return quotaExceeded;\n}\n","'use strict';\n\nvar each = require('@ndhoule/each');\n\nvar CLOCK_LATE_FACTOR = 2;\n\nvar defaultClock = {\n setTimeout: function(fn, ms) {\n return window.setTimeout(fn, ms);\n },\n clearTimeout: function(id) {\n return window.clearTimeout(id);\n },\n Date: window.Date\n};\n\nvar clock = defaultClock;\n\nvar modes = {\n ASAP: 1,\n RESCHEDULE: 2,\n ABANDON: 3\n};\n\nfunction Schedule() {\n this.tasks = {};\n this.nextId = 1;\n}\n\nSchedule.prototype.now = function() {\n return +new clock.Date();\n};\n\nSchedule.prototype.run = function(task, timeout, mode) {\n var id = this.nextId++;\n\n this.tasks[id] = clock.setTimeout(this._handle(id, task, timeout, mode || modes.ASAP), timeout);\n return id;\n};\n\nSchedule.prototype.cancel = function(id) {\n if (this.tasks[id]) {\n clock.clearTimeout(this.tasks[id]);\n delete this.tasks[id];\n }\n};\n\nSchedule.prototype.cancelAll = function() {\n each(clock.clearTimeout, this.tasks);\n this.tasks = {};\n};\n\nSchedule.prototype._handle = function(id, callback, timeout, mode) {\n var self = this;\n var start = self.now();\n return function() {\n delete self.tasks[id];\n if (mode >= modes.RESCHEDULE && start + timeout * CLOCK_LATE_FACTOR < self.now()) {\n if (mode === modes.RESCHEDULE) {\n self.run(callback, timeout, mode);\n }\n return;\n }\n return callback();\n };\n};\n\nSchedule.setClock = function(newClock) {\n clock = newClock;\n};\n\nSchedule.resetClock = function() {\n clock = defaultClock;\n};\n\nSchedule.Modes = modes;\n\nmodule.exports = Schedule;\n","\n/**\n * Expose `debug()` as the module.\n */\n\nmodule.exports = debug;\n\n/**\n * Create a debugger with the given `name`.\n *\n * @param {String} name\n * @return {Type}\n * @api public\n */\n\nfunction debug(name) {\n if (!debug.enabled(name)) return function(){};\n\n return function(fmt){\n fmt = coerce(fmt);\n\n var curr = new Date;\n var ms = curr - (debug[name] || curr);\n debug[name] = curr;\n\n fmt = name\n + ' '\n + fmt\n + ' +' + debug.humanize(ms);\n\n // This hackery is required for IE8\n // where `console.log` doesn't have 'apply'\n window.console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n }\n}\n\n/**\n * The currently active debug mode names.\n */\n\ndebug.names = [];\ndebug.skips = [];\n\n/**\n * Enables a debug mode by name. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} name\n * @api public\n */\n\ndebug.enable = function(name) {\n try {\n localStorage.debug = name;\n } catch(e){}\n\n var split = (name || '').split(/[\\s,]+/)\n , len = split.length;\n\n for (var i = 0; i < len; i++) {\n name = split[i].replace('*', '.*?');\n if (name[0] === '-') {\n debug.skips.push(new RegExp('^' + name.substr(1) + '$'));\n }\n else {\n debug.names.push(new RegExp('^' + name + '$'));\n }\n }\n};\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\ndebug.disable = function(){\n debug.enable('');\n};\n\n/**\n * Humanize the given `ms`.\n *\n * @param {Number} m\n * @return {String}\n * @api private\n */\n\ndebug.humanize = function(ms) {\n var sec = 1000\n , min = 60 * 1000\n , hour = 60 * min;\n\n if (ms >= hour) return (ms / hour).toFixed(1) + 'h';\n if (ms >= min) return (ms / min).toFixed(1) + 'm';\n if (ms >= sec) return (ms / sec | 0) + 's';\n return ms + 'ms';\n};\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\ndebug.enabled = function(name) {\n for (var i = 0, len = debug.skips.length; i < len; i++) {\n if (debug.skips[i].test(name)) {\n return false;\n }\n }\n for (var i = 0, len = debug.names.length; i < len; i++) {\n if (debug.names[i].test(name)) {\n return true;\n }\n }\n return false;\n};\n\n/**\n * Coerce `val`.\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n// persist\n\ntry {\n if (window.localStorage) debug.enable(localStorage.debug);\n} catch(e){}\n","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n for (var key in Emitter.prototype) {\r\n obj[key] = Emitter.prototype[key];\r\n }\r\n return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n .push(fn);\r\n return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n function on() {\r\n this.off(event, on);\r\n fn.apply(this, arguments);\r\n }\r\n\r\n on.fn = fn;\r\n this.on(event, on);\r\n return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n this._callbacks = this._callbacks || {};\r\n\r\n // all\r\n if (0 == arguments.length) {\r\n this._callbacks = {};\r\n return this;\r\n }\r\n\r\n // specific event\r\n var callbacks = this._callbacks['$' + event];\r\n if (!callbacks) return this;\r\n\r\n // remove all handlers\r\n if (1 == arguments.length) {\r\n delete this._callbacks['$' + event];\r\n return this;\r\n }\r\n\r\n // remove specific handler\r\n var cb;\r\n for (var i = 0; i < callbacks.length; i++) {\r\n cb = callbacks[i];\r\n if (cb === fn || cb.fn === fn) {\r\n callbacks.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n // Remove event specific arrays for event types that no\r\n // one is subscribed for to avoid memory leak.\r\n if (callbacks.length === 0) {\r\n delete this._callbacks['$' + event];\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n this._callbacks = this._callbacks || {};\r\n\r\n var args = new Array(arguments.length - 1)\r\n , callbacks = this._callbacks['$' + event];\r\n\r\n for (var i = 1; i < arguments.length; i++) {\r\n args[i - 1] = arguments[i];\r\n }\r\n\r\n if (callbacks) {\r\n callbacks = callbacks.slice(0);\r\n for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n callbacks[i].apply(this, args);\r\n }\r\n }\r\n\r\n return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n this._callbacks = this._callbacks || {};\r\n return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n return !! this.listeners(event).length;\r\n};\r\n","'use strict';\n\nvar uuid = require('@lukeed/uuid').v4;\nvar Store = require('./store');\nvar each = require('@ndhoule/each');\nvar Schedule = require('./schedule');\nvar debug = require('debug')('localstorage-retry');\nvar Emitter = require('component-emitter');\n\n// Some browsers don't support Function.prototype.bind, so just including a simplified version here\nfunction bind(func, obj) {\n return function() {\n return func.apply(obj, arguments);\n };\n}\n\n/**\n * @callback processFunc\n * @param {Mixed} item The item added to the queue to process\n * @param {Function} done A function to call when processing is completed.\n * @param {Error} Optional error parameter if the processing failed\n * @param {Response} Optional response parameter to emit for async handling\n */\n\n/**\n * Constructs a Queue backed by localStorage\n *\n * @constructor\n * @param {String} name The name of the queue. Will be used to find abandoned queues and retry their items\n * @param {Object} [opts] Optional argument to override `maxItems`, `maxAttempts`, `minRetryDelay, `maxRetryDelay`, `backoffFactor` and `backoffJitter`.\n * @param {processFunc} fn The function to call in order to process an item added to the queue\n */\nfunction Queue(name, opts, fn) {\n if (typeof opts === 'function') fn = opts;\n this.name = name;\n this.id = uuid();\n this.fn = fn;\n this.maxItems = opts.maxItems || Infinity;\n this.maxAttempts = opts.maxAttempts || Infinity;\n\n this.backoff = {\n MIN_RETRY_DELAY: opts.minRetryDelay || 1000,\n MAX_RETRY_DELAY: opts.maxRetryDelay || 30000,\n FACTOR: opts.backoffFactor || 2,\n JITTER: opts.backoffJitter || 0\n };\n\n // painstakingly tuned. that's why they're not \"easily\" configurable\n this.timeouts = {\n ACK_TIMER: 1000,\n RECLAIM_TIMER: 3000,\n RECLAIM_TIMEOUT: 10000,\n RECLAIM_WAIT: 500\n };\n\n this.keys = {\n IN_PROGRESS: 'inProgress',\n QUEUE: 'queue',\n RECLAIM_START: 'reclaimStart',\n RECLAIM_END: 'reclaimEnd',\n ACK: 'ack'\n };\n\n this._schedule = new Schedule();\n this._processId = 0;\n\n // Set up our empty queues\n this._store = new Store(this.name, this.id, this.keys);\n this._store.set(this.keys.IN_PROGRESS, {});\n this._store.set(this.keys.QUEUE, []);\n\n // bind recurring tasks for ease of use\n this._ack = bind(this._ack, this);\n this._checkReclaim = bind(this._checkReclaim, this);\n this._processHead = bind(this._processHead, this);\n\n this._running = false;\n}\n\n/**\n * Mix in event emitter\n */\n\nEmitter(Queue.prototype);\n\n/**\n * Starts processing the queue\n */\nQueue.prototype.start = function() {\n if (this._running) {\n this.stop();\n }\n this._running = true;\n this._ack();\n this._checkReclaim();\n this._processHead();\n};\n\n/**\n * Stops processing the queue\n */\nQueue.prototype.stop = function() {\n this._schedule.cancelAll();\n this._running = false;\n};\n\n/**\n * Decides whether to retry. Overridable.\n *\n * @param {Object} item The item being processed\n * @param {Number} attemptNumber The attemptNumber (1 for first retry)\n * @param {Error} error The error from previous attempt, if there was one\n * @return {Boolean} Whether to requeue the message\n */\nQueue.prototype.shouldRetry = function(_, attemptNumber) {\n if (attemptNumber > this.maxAttempts) return false;\n return true;\n};\n\n/**\n * Calculates the delay (in ms) for a retry attempt\n *\n * @param {Number} attemptNumber The attemptNumber (1 for first retry)\n * @return {Number} The delay in milliseconds to wait before attempting a retry\n */\nQueue.prototype.getDelay = function(attemptNumber) {\n var ms = this.backoff.MIN_RETRY_DELAY * Math.pow(this.backoff.FACTOR, attemptNumber);\n if (this.backoff.JITTER) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.backoff.JITTER * ms);\n if (Math.floor(rand * 10) < 5) {\n ms -= deviation;\n } else {\n ms += deviation;\n }\n }\n return Number(Math.min(ms, this.backoff.MAX_RETRY_DELAY).toPrecision(1));\n};\n\n/**\n * Adds an item to the queue\n *\n * @param {Mixed} item The item to process\n */\nQueue.prototype.addItem = function(item) {\n this._enqueue({\n item: item,\n attemptNumber: 0,\n time: this._schedule.now(),\n id: uuid()\n });\n};\n\n/**\n * Adds an item to the retry queue\n *\n * @param {Mixed} item The item to retry\n * @param {Number} attemptNumber The attempt number (1 for first retry)\n * @param {Error} [error] The error from previous attempt, if there was one\n * @param {String} [id] The id of the queued message used for tracking duplicate entries\n */\nQueue.prototype.requeue = function(item, attemptNumber, error, id) {\n if (this.shouldRetry(item, attemptNumber, error)) {\n this._enqueue({\n item: item,\n attemptNumber: attemptNumber,\n time: this._schedule.now() + this.getDelay(attemptNumber),\n id: id || uuid()\n });\n } else {\n this.emit('discard', item, attemptNumber);\n }\n};\n\nQueue.prototype._enqueue = function(entry) {\n var queue = this._store.get(this.keys.QUEUE) || [];\n queue = queue.slice(-(this.maxItems - 1));\n queue.push(entry);\n queue = queue.sort(function(a,b) {\n return a.time - b.time;\n });\n\n this._store.set(this.keys.QUEUE, queue);\n\n if (this._running) {\n this._processHead();\n }\n};\n\nQueue.prototype._processHead = function() {\n var self = this;\n var store = this._store;\n\n // cancel the scheduled task if it exists\n this._schedule.cancel(this._processId);\n\n // Pop the head off the queue\n var queue = store.get(this.keys.QUEUE) || [];\n var inProgress = store.get(this.keys.IN_PROGRESS) || {};\n var now = this._schedule.now();\n var toRun = [];\n\n function enqueue(el, id) {\n toRun.push({\n item: el.item,\n done: function handle(err, res) {\n var inProgress = store.get(self.keys.IN_PROGRESS) || {};\n delete inProgress[id];\n store.set(self.keys.IN_PROGRESS, inProgress);\n self.emit('processed', err, res, el.item);\n if (err) {\n self.requeue(el.item, el.attemptNumber + 1, err, el.id);\n }\n }\n });\n }\n\n var inProgressSize = Object.keys(inProgress).length;\n\n while (queue.length && queue[0].time <= now && inProgressSize++ < self.maxItems) {\n var el = queue.shift();\n var id = uuid();\n\n // Save this to the in progress map\n inProgress[id] = {\n item: el.item,\n attemptNumber: el.attemptNumber,\n time: self._schedule.now()\n };\n\n enqueue(el, id);\n }\n\n store.set(this.keys.QUEUE, queue);\n store.set(this.keys.IN_PROGRESS, inProgress);\n\n each(function(el) {\n // TODO: handle fn timeout\n try {\n self.fn(el.item, el.done);\n } catch (err) {\n debug('Process function threw error: ' + err);\n }\n }, toRun);\n\n // re-read the queue in case the process function finished immediately or added another item\n queue = store.get(this.keys.QUEUE) || [];\n this._schedule.cancel(this._processId);\n if (queue.length > 0) {\n this._processId = this._schedule.run(this._processHead, queue[0].time - now, Schedule.Modes.ASAP);\n }\n};\n\n// Ack continuously to prevent other tabs from claiming our queue\nQueue.prototype._ack = function() {\n this._store.set(this.keys.ACK, this._schedule.now());\n this._store.set(this.keys.RECLAIM_START, null);\n this._store.set(this.keys.RECLAIM_END, null);\n this._schedule.run(this._ack, this.timeouts.ACK_TIMER, Schedule.Modes.ASAP);\n};\n\nQueue.prototype._checkReclaim = function() {\n var self = this;\n\n function tryReclaim(store) {\n store.set(self.keys.RECLAIM_START, self.id);\n store.set(self.keys.ACK, self._schedule.now());\n\n self._schedule.run(function() {\n if (store.get(self.keys.RECLAIM_START) !== self.id) return;\n store.set(self.keys.RECLAIM_END, self.id);\n\n self._schedule.run(function() {\n if (store.get(self.keys.RECLAIM_END) !== self.id) return;\n if (store.get(self.keys.RECLAIM_START) !== self.id) return;\n self._reclaim(store.id);\n }, self.timeouts.RECLAIM_WAIT, Schedule.Modes.ABANDON);\n }, self.timeouts.RECLAIM_WAIT, Schedule.Modes.ABANDON);\n }\n\n function findOtherQueues(name) {\n var res = [];\n var storage = self._store.getOriginalEngine();\n for (var i = 0; i < storage.length; i++) {\n var k = storage.key(i);\n var parts = k.split('.');\n if (parts.length !== 3) continue;\n if (parts[0] !== name) continue;\n if (parts[2] !== 'ack') continue;\n res.push(new Store(name, parts[1], self.keys));\n }\n return res;\n }\n\n each(function(store) {\n if (store.id === self.id) return;\n if (self._schedule.now() - store.get(self.keys.ACK) < self.timeouts.RECLAIM_TIMEOUT) return;\n tryReclaim(store);\n }, findOtherQueues(this.name));\n\n this._schedule.run(this._checkReclaim, this.timeouts.RECLAIM_TIMER, Schedule.Modes.RESCHEDULE);\n};\n\nQueue.prototype._reclaim = function(id) {\n var self = this;\n var other = new Store(this.name, id, this.keys);\n\n var our = {\n queue: this._store.get(this.keys.QUEUE) || []\n };\n\n var their = {\n inProgress: other.get(this.keys.IN_PROGRESS) || {},\n queue: other.get(this.keys.QUEUE) || []\n };\n\n var trackMessageIds = [];\n\n var addConcatQueue = function(queue, incrementAttemptNumberBy) {\n each(function(el) {\n var id = el.id || uuid();\n if (trackMessageIds.indexOf(id) >= 0) {\n self.emit('duplication', el.item, el.attemptNumber);\n } else {\n our.queue.push({\n item: el.item,\n attemptNumber: el.attemptNumber + incrementAttemptNumberBy,\n time: self._schedule.now(),\n id: id\n });\n trackMessageIds.push(id);\n }\n }, queue);\n };\n\n // add their queue to ours, resetting run-time to immediate and copying the attempt#\n addConcatQueue(their.queue, 0);\n\n // if the queue is abandoned, all the in-progress are failed. retry them immediately and increment the attempt#\n addConcatQueue(their.inProgress, 1);\n\n our.queue = our.queue.sort(function(a,b) {\n return a.time - b.time;\n });\n\n this._store.set(this.keys.QUEUE, our.queue);\n\n // remove all keys\n other.remove(this.keys.IN_PROGRESS);\n other.remove(this.keys.QUEUE);\n other.remove(this.keys.RECLAIM_START);\n other.remove(this.keys.RECLAIM_END);\n other.remove(this.keys.ACK);\n\n // process the new items we claimed\n this._processHead();\n};\n\nmodule.exports = Queue;\n","\"use strict\";\nexports.__esModule = true;\nexports.COPPAPrivacyModesEnum = exports.BrandsEnum = exports.EnvNames = exports.PlayerMediaStates = exports.ResponseHandlers = exports.ResponseStatusCodes = void 0;\nvar ResponseStatusCodes;\n(function (ResponseStatusCodes) {\n ResponseStatusCodes[ResponseStatusCodes[\"Code201Created\"] = 201] = \"Code201Created\";\n ResponseStatusCodes[ResponseStatusCodes[\"Code400BadRequest\"] = 400] = \"Code400BadRequest\";\n // TODO: add actual response codes or glob patterns here, e.g. 302, 40*, 5**\n ResponseStatusCodes[ResponseStatusCodes[\"Code999Test\"] = 999] = \"Code999Test\";\n})(ResponseStatusCodes = exports.ResponseStatusCodes || (exports.ResponseStatusCodes = {}));\nvar ResponseHandlers;\n(function (ResponseHandlers) {\n ResponseHandlers[\"Success\"] = \"Success\";\n ResponseHandlers[\"Failure\"] = \"Failure\";\n ResponseHandlers[\"Retry\"] = \"Retry\";\n})(ResponseHandlers = exports.ResponseHandlers || (exports.ResponseHandlers = {}));\nvar PlayerMediaStates;\n(function (PlayerMediaStates) {\n PlayerMediaStates[\"PLAYING\"] = \"playing\";\n PlayerMediaStates[\"PENDING\"] = \"pending\";\n})(PlayerMediaStates = exports.PlayerMediaStates || (exports.PlayerMediaStates = {}));\nvar EnvNames;\n(function (EnvNames) {\n EnvNames[\"PROD\"] = \"PROD\";\n EnvNames[\"DEV\"] = \"DEV\";\n EnvNames[\"INTEGRATION\"] = \"INTEGRATION\";\n EnvNames[\"QA\"] = \"TEST\";\n})(EnvNames = exports.EnvNames || (exports.EnvNames = {}));\nvar BrandsEnum;\n(function (BrandsEnum) {\n BrandsEnum[\"TBS\"] = \"TBS\";\n BrandsEnum[\"CNN\"] = \"CNN\";\n BrandsEnum[\"CartoonNetwork\"] = \"CartoonNetwork\";\n BrandsEnum[\"AdultSwim\"] = \"AdultSwim\";\n BrandsEnum[\"TNT\"] = \"TNT\";\n BrandsEnum[\"truTV\"] = \"truTV\";\n BrandsEnum[\"TCM\"] = \"TCM\";\n BrandsEnum[\"BR\"] = \"BR\";\n BrandsEnum[\"NCAA\"] = \"NCAA\";\n BrandsEnum[\"WMInternalEvents\"] = \"WMInternalEvents\";\n BrandsEnum[\"MML\"] = \"MML\";\n BrandsEnum[\"WMSpecialEvents\"] = \"WMSpecialEvents\";\n BrandsEnum[\"psmInvalidType\"] = \"psmInvalidType\";\n})(BrandsEnum = exports.BrandsEnum || (exports.BrandsEnum = {}));\nvar COPPAPrivacyModesEnum;\n(function (COPPAPrivacyModesEnum) {\n COPPAPrivacyModesEnum[\"ALL_ID\"] = \"ALL_ID\";\n COPPAPrivacyModesEnum[\"ZERO_ID\"] = \"ZERO_ID\";\n})(COPPAPrivacyModesEnum = exports.COPPAPrivacyModesEnum || (exports.COPPAPrivacyModesEnum = {}));\n","\"use strict\";\nexports.__esModule = true;\n","\"use strict\";\nexports.__esModule = true;\n","\"use strict\";\nexports.__esModule = true;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nexports.__esModule = true;\n__exportStar(require(\"./enums\"), exports);\n__exportStar(require(\"./payload\"), exports);\n__exportStar(require(\"./psm\"), exports);\n__exportStar(require(\"./telemetry\"), exports);\n","export const MAX_SESSION_DURATION = 1800000; // 30 minutes in ms\nexport const AD_IN_VIEW_PERCENTAGE = 50;\n\nexport const APP_ID =\n 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuZXR3b3JrIjoiYWxsIiwicHJvZHVjdCI6InByaXNtIiwicGxhdGZvcm0iOiJ3ZWIiLCJhcHBJZCI6ImFsbC1wcmlzbS13ZWItNzI4aGtyIn0.4Fk4E28ffoFgCIcgNSG8xX5TP2n3PIU6c3jadumKULo';\n\nexport const URLS = {\n lightningOrigin: 'https://lightning.warnermediacdn.com',\n iFramePath: {\n DEV: '/cdptest/psmtk/getcdpid.html',\n TEST: '/cdptest/psmtk/getcdpid.html',\n PROD: '/cdp/psmtk/getcdpid.html',\n INTEGRATION: '/cdptest/psmtk/getcdpid.html',\n AUTOMATED_TEST: '/cdptest/psmtk/getcdpid.html',\n },\n thirdPartyCookie: '/cdp/psmtk/start.html',\n carouselScript: '/cdp/psm/assets/swiper/swiper-bundle.min.js',\n carouselStyles: '/cdp/psm/assets/swiper/swiper-bundle.min.css',\n locate: 'https://geo.ngtv.io/locate',\n locateV2: 'https://atlas.ngtv.io/v2/locate',\n featureFlag: {\n DEV: 'https://wmff.warnermediacdn.com/psm_2_dev_full.json',\n TEST: 'https://wmff.warnermediacdn.com/psm_2_qa_full.json',\n PROD: 'https://wmff.warnermediacdn.com/psm_2_prod_full.json',\n INTEGRATION: 'https://wmff.warnermediacdn.com/psm_2_brand_integration_full.json',\n AUTOMATED_TEST: 'https://wmff.warnermediacdn.com/psm_2_automated_test_full.json',\n },\n identity: {\n DEV: 'https://dev.receive.wmcdp.io/v1/reg',\n TEST: 'https://test.receive.wmcdp.io/v1/reg',\n PROD: 'https://receive.wmcdp.io/v1/reg',\n INTEGRATION: 'https://test.receive.wmcdp.io/v1/reg',\n AUTOMATED_TEST: 'https://test.receive.wmcdp.io/v1/reg',\n },\n logs: {\n DEV: 'https://dev.receive.wmcdp.io/v1/reg',\n TEST: 'https://test.receive.wmcdp.io/v1/reg',\n PROD: 'https://receive.wmcdp.io/v1/reg',\n INTEGRATION: 'https://test.receive.wmcdp.io/v1/reg',\n AUTOMATED_TEST: 'https://test.receive.wmcdp.io/v1/reg',\n },\n authSvc: {\n DEV: 'https://dev.token.wmcdp.io/v1/token',\n TEST: 'https://test.token.wmcdp.io/v1/token',\n PROD: 'https://token.wmcdp.io/v1/token',\n INTEGRATION: 'https://test.token.wmcdp.io/v1/token',\n AUTOMATED_TEST: 'https://test.token.wmcdp.io/v1/token',\n },\n};\n\nexport const CCPA_LOCATIONS = ['', 'US', 'GU', 'AS', 'PR', 'VI', 'MH', 'UM', 'MP'];\nexport const LOCALSTORAGE_WMUKID_KEY = 'WMUKID';\nexport const LS_SESSION_ID_KEY = 'psmSessionId';\nexport const LS_SESSION_START_KEY = 'psmSessionStart';\nexport const LAST_SESSION_TIME_LOCAL_STORAGE = 'last_session_time_local_storage';\nexport const CONFIG_REFRESH_INTERVAL = 60000;\nexport const PRIVACY_COMPANY_NAME = 'WarnerMedia';\n\nexport const LOCAL_STORAGE_KEY_CCPA_ALLOW_DATA = 'USP_String';\nexport const CCPA_ALLOW_DATA_SALE = '1YNN';\nexport const DEFAULT_CCPA_SETTING = CCPA_ALLOW_DATA_SALE;\nexport const CCPA_DO_NOT_ALLOW_DATA_SALE = '1YYN';\n\nexport const CCPA_NON_USP_LOCATION = '1---';\nexport const COM_SCORE_ALLOW = 1;\nexport const COM_SCORE_DO_NOT_ALLOW = 0;\n\n// Local FF config for FFClient quick init\nexport const featureFlagLocalConfig = {\n featureFlagLibraryVersion: '0.1',\n flags: [\n {\n defaultValue: true,\n id: 'doppler-identity-onstart',\n cohorts: [],\n name: 'FALLBACK_doppler-identity-onstart',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-identity-oncomplete',\n cohorts: [],\n name: 'FALLBACK_doppler-identity-oncomplete',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-session',\n cohorts: [],\n name: 'FALLBACK_doppler-session',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-privacy',\n cohorts: [],\n name: 'FALLBACK_doppler-privacy',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-telemetry',\n cohorts: [],\n name: 'FALLBACK_doppler-telemetry',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-consent-update',\n cohorts: [],\n name: 'FALLBACK_doppler-consent-update',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'doppler-pubsub-event',\n cohorts: [],\n name: 'FALLBACK_doppler-pubsub-event',\n type: 'boolean',\n },\n {\n defaultValue: true,\n id: 'doppler-send-logs',\n cohorts: [],\n name: 'FALLBACK_doppler-send-logs',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'doppler-send-token-event',\n cohorts: [],\n name: 'FALLBACK_doppler-send-token-event',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'outside-us-location-check',\n cohorts: [],\n name: 'FALLBACK_outside_us_location_check',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'sendAuthToken',\n cohorts: [],\n name: 'FALLBACK_sendAuthToken',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'auth-service',\n cohorts: [],\n name: 'FALLBACK_auth-service',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'isInAuthTokenExperiment',\n cohorts: [],\n name: 'FALLBACK_isInAuthTokenExperiment',\n type: 'boolean',\n },\n {\n defaultValue: false,\n id: 'sendWMSegs',\n cohorts: [],\n name: 'FALLBACK_sendWMSegs',\n type: 'boolean',\n },\n ],\n};\n\n// Default flag values in case there's an issue with the FF client\nexport const featureFlagDefaults = {\n 'auth-service': false,\n 'doppler-identity-onstart': true,\n 'doppler-identity-oncomplete': true,\n 'doppler-session': true,\n 'doppler-privacy': true,\n 'doppler-telemetry': true,\n 'doppler-consent-update': true,\n 'doppler-pubsub-event': false,\n 'outside-us-location-check': false,\n 'doppler-send-logs': true,\n 'doppler-send-token-event': false,\n sendAuthToken: false,\n isInAuthTokenExperiment: false,\n sendWMSegs: false,\n // for unit tests\n 'test-enabled': true,\n 'test-disabled': false,\n};\n\nexport const queueOptions = {\n minRetryDelay: 30000,\n maxRetryDelay: 120000,\n maxItems: 5,\n maxAttempts: 10,\n backoffFactor: 2,\n backoffJitter: 0,\n};\n\nexport enum COPPAPrivacyModesEnum {\n ALL_ID = 'ALL_ID',\n ZERO_ID = 'ZERO_ID',\n}\n","import { PsmConfig, SessionProperties, LocationProperties } from '../interfaces';\nimport pkg from '../../package.json';\nimport { CCPA_LOCATIONS, COPPAPrivacyModesEnum, APP_ID } from '../utils/constants';\n\nclass Core {\n // Flag set to true when Prism has initialized\n ready = false;\n\n // Default values from Prism config\n config: PsmConfig = {\n appId: APP_ID,\n platform: 'web',\n brand: '',\n psmBrandToken: '',\n subBrand: '',\n productName: '',\n psmEnvironment: undefined,\n psmPlatform: '',\n psmTelEnabled: true,\n };\n\n // Privacy mode to track if user's data can be shared\n coppaPrivacyMode: COPPAPrivacyModesEnum;\n\n // Consent Rule to track how Prism was loaded based on user consent\n consentRule = 'Other';\n\n // Consent categories used loading Prism for non-US users\n consentCategories: Record;\n\n // Feature flags\n flags = [];\n\n // Geolocation API response\n location = {\n asn: {\n id: '',\n name: '',\n },\n continent: '',\n continentName: '',\n country: '',\n country_alpha2: '',\n country_alpha3: '',\n ip_address: '',\n lat: '',\n lon: '',\n proxy: null,\n states: [\n {\n cities: [],\n counties: [],\n state: '',\n zipcodes: [],\n },\n ],\n };\n\n timezone = null;\n\n // WMUKID from cookie or generated when Prism is initialized\n wmukid = 'Unknown';\n\n // CDPID from cookie or generated when Prism is initialized\n cdpid = null;\n\n // Country code value for location-guarded logic\n countryCode: string;\n\n // Session properties as determine on initialization\n session: SessionProperties;\n\n //TODO: Version must be out of Common. Is Platform specific\n getVersion() {\n return pkg.version;\n }\n\n getConfig() {\n return this.config;\n }\n\n getBrand(): string {\n return this.config.brand;\n }\n\n getBrandToken(): string {\n return this.config.psmBrandToken;\n }\n\n getSubBrand(): string {\n return this.config.subBrand;\n }\n\n getCoppaPrivacyMode(): COPPAPrivacyModesEnum {\n return this.coppaPrivacyMode;\n }\n\n getCoreWMUKID(): string {\n return this.wmukid;\n }\n\n setCoreWMUKID(wmukid: string) {\n this.wmukid = wmukid;\n }\n\n getSessionProperties(): SessionProperties {\n return this.session;\n }\n\n validateConfig(config: Partial) {\n const errors: string[] = [];\n\n if (!this.hasProperty('psmEnvironment', config)) errors.push('Please specify your psmEnvironment.');\n if (!this.hasProperty('brand', config)) errors.push('Please specify your brand.');\n\n if (errors.length) {\n const err = new Error(['[PSM]: Invalid configuration provided.'].concat(errors).join('\\n'));\n throw err;\n }\n }\n\n hasProperty(prop: string, obj: any) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n }\n\n getLocationProperties(): LocationProperties {\n return {\n city: this.location.states[0].cities[0],\n state: this.location.states[0].state,\n country: this.location.country,\n zip: this.location.states[0].zipcodes[0],\n timezone: this.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,\n locale: 'locale', //TODO: install Native Modules\n language: 'language', //solution: https://stackoverflow.com/questions/33468746/whats-the-best-way-to-get-device-locale-in-react-native-ios\n };\n }\n\n initCoppaPrivacyMode(): void {\n let coppaPrivacyMode: COPPAPrivacyModesEnum = COPPAPrivacyModesEnum.ALL_ID;\n const isUSTerritories = CCPA_LOCATIONS.includes(this.getLocationProperties().country);\n if (!isUSTerritories) {\n coppaPrivacyMode = COPPAPrivacyModesEnum.ZERO_ID;\n } else if (this.config?.privacyMode) {\n coppaPrivacyMode = this.config.privacyMode;\n }\n this.coppaPrivacyMode = coppaPrivacyMode;\n }\n}\n\nexport default Core;\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { v4 as uuid } from 'uuid';\nimport { cookie } from '@turnercode/cdp-cookie';\nimport { cookiesEnabled, fromQueryString } from '../utils/browser';\nimport { URLS } from '../utils/constants';\nimport { debug } from '../utils/logger';\nimport { CdpidValue, WmukidValue } from '../interfaces';\nimport { findFrame } from './privacy';\nimport { COPPAPrivacyModesEnum } from '../utils/constants';\n\nlet wmukid: WmukidValue = '';\nlet wmukidStable = '';\nlet cdpid: CdpidValue = '';\n\nfunction checkPlatform(platform: string): boolean {\n switch (platform) {\n case 'Samsung TV':\n return false;\n break;\n case 'Vizio TV':\n return false;\n break;\n case 'LG TV':\n return false;\n break;\n default:\n return true;\n break;\n }\n}\n\nexport function isUUID(id: string) {\n return /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i.test(id);\n}\n\nexport function searchURL(): string | null {\n const utm_term = fromQueryString('utm_term', window.location.href);\n const match = new RegExp(/cdpid_([0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12})/i).exec(\n utm_term\n );\n let result = null;\n if (match) {\n result = match[1];\n }\n return result;\n}\n\nexport function updateCdpData(cdpId: string, wmukId: string) {\n if (!isUUID(cdpId)) {\n debug({\n message: `CDPID value ${JSON.stringify(cdpid)} is invalid. Returning without updating`,\n methodName: 'updateCdpData',\n eventType: 'cdpid',\n });\n } else {\n cdpid = searchURL() || cdpId; // If no prior CPDID on current page, update with CPDPID in url from inbrain\n cookie.set('CDPID', JSON.stringify({ cdpId: cdpid, wmukId }), {\n samesite: 'None',\n secure: true,\n encode: false,\n });\n }\n}\n\nfunction createFrame(name: string, src: string) {\n const iframe = document.createElement('iframe');\n\n iframe.setAttribute('id', name);\n iframe.setAttribute('style', 'display:none');\n iframe.setAttribute('src', src);\n document.body.appendChild(iframe);\n}\n\nconst parseCookie = (str) =>\n str\n .split(';')\n .map((v) => v.split('='))\n .reduce((acc, v) => {\n acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim());\n return acc;\n }, {});\n\nexport function initWMUKID(psmPrivacyMode: COPPAPrivacyModesEnum, inIframe): string {\n if (cookiesEnabled()) {\n wmukid = !inIframe ? (cookie.get('WMUKID') as WmukidValue) : parseCookie(document.cookie)['WMUKID'];\n wmukidStable = !inIframe ? (cookie.get('WMUKID_STABLE') as string) : parseCookie(document.cookie)['WMUKID_STABLE'];\n\n debug({\n message: `[PSM]: Cookies enabled. Retrieving ID values\n WMUKID: ${JSON.stringify(wmukid)}\n WMUKID_STABLE: ${wmukidStable}\n `,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n\n if (wmukidStable == null) {\n if (wmukid == null) {\n // If the WMUKID does not exist, generate one, set a cookie, and track the newly-registered ID\n wmukidStable = uuid();\n debug({\n message: `WMUKID and WMUKID_STABLE cookies not found. Generating WMUKID_STABLE value: ${wmukidStable}`,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n } else if (typeof wmukid === 'object' && 'id' in wmukid) {\n // If a legacy WMUKID cookie exists, pull the ID value from it\n wmukidStable = wmukid.id;\n debug({\n message: `Legacy WMUKID value ${wmukid.id} found. Setting WMUKID_STABLE value: ${wmukidStable}`,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n } else {\n wmukidStable = wmukid;\n debug({\n message: `WMUKID string value ${wmukid} found. Setting WMUKID_STABLE value: ${wmukidStable}`,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n }\n }\n\n debug({\n message: `Setting WMUKID_STABLE cookie to ${wmukidStable}. Cookie options: ${JSON.stringify(cookie.options())}`,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n\n if (psmPrivacyMode === COPPAPrivacyModesEnum.ZERO_ID) {\n if (inIframe) {\n document.cookie = `WMUKID_STABLE=${wmukidStable}; max-age=0; SameSite=None; Secure`;\n document.cookie = `dateid=${wmukid}; max-age=0; SameSite=None; Secure`;\n } else {\n cookie.set(\n 'WMUKID_STABLE',\n wmukidStable,\n cookie.options({\n maxage: 0,\n })\n );\n cookie.set(\n 'datid',\n wmukidStable,\n cookie.options({\n maxage: 0,\n })\n );\n }\n } else {\n if (inIframe) {\n document.cookie = `WMUKID_STABLE=${wmukidStable}; SameSite=None; Secure`;\n document.cookie = `dateid=${wmukid}; SameSite=None; Secure`;\n } else {\n cookie.set('WMUKID_STABLE', wmukidStable);\n cookie.set('datid', wmukidStable);\n }\n }\n return wmukidStable;\n }\n return '';\n}\n\n/**\n * Initializes the Prism identity module, which is responsible for:\n * - Managing the WMUKID\n * - Capturing third-party IDs\n * - Sending data to Doppler\n */\nexport function initCDPID(env: string, platform: string): Promise {\n return new Promise((resolve) => {\n window?.addEventListener(\n 'message',\n (e: MessageEvent) => {\n if (e.origin === URLS.lightningOrigin) {\n debug({\n message: `Updating CDPID from iFrame value: ${JSON.stringify(e.data)}`,\n methodName: 'initIdentity',\n eventType: 'message',\n });\n updateCdpData(e.data, wmukidStable);\n resolve(e.data);\n }\n },\n false\n );\n\n if (cookiesEnabled()) {\n cdpid = cookie.get('CDPID') as CdpidValue;\n const cdpidValid = cdpid && typeof cdpid === 'object' && 'cdpId' in cdpid && isUUID(cdpid.cdpId);\n\n debug({\n message: `[PSM]: Cookies enabled. Retrieving ID values\n CDPID: ${JSON.stringify(cdpid)}\n `,\n methodName: 'initIdentity',\n eventType: 'identity',\n });\n\n if (cdpid === null || !cdpidValid) {\n if (findFrame('prism_toolkit') === null) {\n if (checkPlatform(platform)) {\n createFrame('prism_toolkit', URLS.lightningOrigin + URLS.iFramePath[env]);\n } else {\n resolve('');\n }\n }\n } else if (typeof cdpid === 'object' && 'cdpId' in cdpid && 'wmukId' in cdpid && cdpidValid) {\n const cdpidStr: string = cdpid.cdpId;\n const wmukidStr: string = cdpid.wmukId;\n\n if (wmukidStable !== wmukidStr) {\n debug({\n message: `Updating CDPID value ${cdpidStr} with WMUKID: ${wmukidStable}`,\n methodName: 'initIdentity',\n eventType: 'cdpid',\n });\n updateCdpData(cdpidStr, wmukidStable);\n } else {\n debug({\n message: `CDPID cookie has already been set to value ${JSON.stringify(\n cdpid\n )}. To start a new test, delete the CDPID cookie on this domain and lightning.warnermediacdn.com.`,\n methodName: 'initIdentity',\n eventType: 'cdpid',\n });\n }\n resolve(cdpidStr);\n }\n }\n });\n}\n","\n/**\n * Parse the given `url`.\n *\n * @param {String} str\n * @return {Object}\n * @api public\n */\n\nexports.parse = function(url){\n var a = document.createElement('a');\n a.href = url;\n return {\n href: a.href,\n host: a.host || location.host,\n port: ('0' === a.port || '' === a.port) ? port(a.protocol) : a.port,\n hash: a.hash,\n hostname: a.hostname || location.hostname,\n pathname: a.pathname.charAt(0) != '/' ? '/' + a.pathname : a.pathname,\n protocol: !a.protocol || ':' == a.protocol ? location.protocol : a.protocol,\n search: a.search,\n query: a.search.slice(1)\n };\n};\n\n/**\n * Check if `url` is absolute.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isAbsolute = function(url){\n return 0 == url.indexOf('//') || !!~url.indexOf('://');\n};\n\n/**\n * Check if `url` is relative.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isRelative = function(url){\n return !exports.isAbsolute(url);\n};\n\n/**\n * Check if `url` is cross domain.\n *\n * @param {String} url\n * @return {Boolean}\n * @api public\n */\n\nexports.isCrossDomain = function(url){\n url = exports.parse(url);\n var location = exports.parse(window.location.href);\n return url.hostname !== location.hostname\n || url.port !== location.port\n || url.protocol !== location.protocol;\n};\n\n/**\n * Return default port for `protocol`.\n *\n * @param {String} protocol\n * @return {String}\n * @api private\n */\nfunction port (protocol){\n switch (protocol) {\n case 'http:':\n return 80;\n case 'https:':\n return 443;\n default:\n return location.port;\n }\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('cookie');\n\n/**\n * Set or get cookie `name` with `value` and `options` object.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @return {Mixed}\n * @api public\n */\n\nmodule.exports = function(name, value, options){\n switch (arguments.length) {\n case 3:\n case 2:\n return set(name, value, options);\n case 1:\n return get(name);\n default:\n return all();\n }\n};\n\n/**\n * Set cookie `name` to `value`.\n *\n * @param {String} name\n * @param {String} value\n * @param {Object} options\n * @api private\n */\n\nfunction set(name, value, options) {\n options = options || {};\n var str = encode(name) + '=' + encode(value);\n\n if (null == value) options.maxage = -1;\n\n if (options.maxage) {\n options.expires = new Date(+new Date + options.maxage);\n }\n\n if (options.path) str += '; path=' + options.path;\n if (options.domain) str += '; domain=' + options.domain;\n if (options.expires) str += '; expires=' + options.expires.toUTCString();\n if (options.secure) str += '; secure';\n\n document.cookie = str;\n}\n\n/**\n * Return all cookies.\n *\n * @return {Object}\n * @api private\n */\n\nfunction all() {\n var str;\n try {\n str = document.cookie;\n } catch (err) {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(err.stack || err);\n }\n return {};\n }\n return parse(str);\n}\n\n/**\n * Get cookie `name`.\n *\n * @param {String} name\n * @return {String}\n * @api private\n */\n\nfunction get(name) {\n return all()[name];\n}\n\n/**\n * Parse cookie `str`.\n *\n * @param {String} str\n * @return {Object}\n * @api private\n */\n\nfunction parse(str) {\n var obj = {};\n var pairs = str.split(/ *; */);\n var pair;\n if ('' == pairs[0]) return obj;\n for (var i = 0; i < pairs.length; ++i) {\n pair = pairs[i].split('=');\n obj[decode(pair[0])] = decode(pair[1]);\n }\n return obj;\n}\n\n/**\n * Encode.\n */\n\nfunction encode(value){\n try {\n return encodeURIComponent(value);\n } catch (e) {\n debug('error `encode(%o)` - %o', value, e)\n }\n}\n\n/**\n * Decode.\n */\n\nfunction decode(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n debug('error `decode(%o)` - %o', value, e)\n }\n}\n","'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar parse = require('component-url').parse;\nvar cookie = require('component-cookie');\n\n/**\n * Get the top domain.\n *\n * The function constructs the levels of domain and attempts to set a global\n * cookie on each one when it succeeds it returns the top level domain.\n *\n * The method returns an empty string when the hostname is an ip or `localhost`.\n *\n * Example levels:\n *\n * domain.levels('http://www.google.co.uk');\n * // => [\"co.uk\", \"google.co.uk\", \"www.google.co.uk\"]\n *\n * Example:\n *\n * domain('http://localhost:3000/baz');\n * // => ''\n * domain('http://dev:3000/baz');\n * // => ''\n * domain('http://127.0.0.1:3000/baz');\n * // => ''\n * domain('http://segment.io/baz');\n * // => 'segment.io'\n *\n * @param {string} url\n * @return {string}\n * @api public\n */\nfunction domain(url) {\n var cookie = exports.cookie;\n var levels = exports.levels(url);\n\n // Lookup the real top level one.\n for (var i = 0; i < levels.length; ++i) {\n var cname = '__tld__';\n var domain = levels[i];\n var opts = { domain: '.' + domain };\n\n cookie(cname, 1, opts);\n if (cookie(cname)) {\n cookie(cname, null, opts);\n return domain;\n }\n }\n\n return '';\n}\n\n/**\n * Levels returns all levels of the given url.\n *\n * @param {string} url\n * @return {Array}\n * @api public\n */\ndomain.levels = function(url) {\n var host = parse(url).hostname;\n var parts = host.split('.');\n var last = parts[parts.length - 1];\n var levels = [];\n\n // Ip address.\n if (parts.length === 4 && last === parseInt(last, 10)) {\n return levels;\n }\n\n // Localhost.\n if (parts.length <= 1) {\n return levels;\n }\n\n // Create levels.\n for (var i = parts.length - 2; i >= 0; --i) {\n levels.push(parts.slice(i).join('.'));\n }\n\n return levels;\n};\n\n/**\n * Expose cookie on domain.\n */\ndomain.cookie = cookie;\n\n/*\n * Exports.\n */\n\nexports = module.exports = domain;\n","import findTopDomain from '@segment/top-domain';\nimport { cookieHelper, debug } from './helper';\n\nexport interface CookieModule {\n options(options?: CookieOptions): void | CookieOptions;\n set(name: string, value: string | object | boolean): boolean;\n get(name: string): string | object | boolean | null;\n remove(name: string): boolean;\n}\n\nexport interface CookieOptions {\n maxage?: number;\n expires?: Date;\n domain?: string | null;\n path?: string;\n secure?: boolean;\n samesite?: string;\n useRootDomain?: boolean;\n encode?: boolean;\n}\n\nexport class Cookie implements CookieModule {\n private _options: CookieOptions = {};\n\n constructor(options?: CookieOptions) {\n this.options = this.options.bind(this);\n this.set = this.set.bind(this);\n this.get = this.get.bind(this);\n this.getAll = this.getAll.bind(this);\n this.remove = this.remove.bind(this);\n this.options(options);\n }\n\n options(options?: CookieOptions): undefined | CookieOptions {\n if (arguments.length === 0) return this._options;\n\n options = options || {};\n\n let domain: CookieOptions['domain'] = options.domain || `.${findTopDomain(window.location.href)}`;\n\n if (domain === '.') {\n domain = null;\n }\n\n this._options = {\n maxage: 31536000000,\n path: '/',\n samesite: 'Lax',\n encode: true,\n ...options,\n domain,\n };\n\n // http://curl.haxx.se/rfc/cookie_spec.html\n // https://publicsuffix.org/list/effective_tld_names.dat\n //\n // try setting a dummy cookie with the options\n // if the cookie isn't set, it probably means\n // that the domain is on the public suffix list\n // like myapp.deployment.com or localhost / ip.\n this.set('psm:test', true, this._options);\n if (!this.get('psm:test')) {\n debug('[Cookie]: psm:test cookie could not be set at domain: ', this._options.domain);\n const reg = new RegExp(document.location.hostname, 'g');\n if (document.referrer !== '' && document.referrer.search(reg) === -1) {\n this._options.samesite = 'None';\n } else {\n this._options.domain = null;\n }\n }\n this.remove('psm:test');\n\n debug('[COOKIE]: this._options', this._options);\n }\n\n set(name: string, value: string | object | boolean, options: Partial = {}): boolean {\n const opts = { ...this._options, ...options };\n\n debug('[COOKIE]: this.set() options', opts);\n\n try {\n if (typeof value !== 'string') {\n value = JSON.stringify(value);\n }\n // @ts-ignore\n cookieHelper(name, value === 'null' ? null : value, opts);\n return true;\n } catch (err) {\n debug('[COOKIE]: this.set() encountered an error', err);\n return false;\n }\n }\n\n get(name: string): string | object | boolean | null {\n const value = cookieHelper(name) as string | undefined;\n\n try {\n return JSON.parse(value);\n } catch (err) {\n // debug('[COOKIE]: this.get() encountered an error', err);\n return value || null;\n }\n }\n\n getAll() {\n return cookieHelper();\n }\n\n remove(name: string): boolean {\n try {\n cookieHelper(name, null, { ...this._options });\n return true;\n } catch (err) {\n debug('[COOKIE]: this.remove() encountered an error', err);\n return false;\n }\n }\n}\n\nexport const cookie = new Cookie();\nexport { findTopDomain };\n","import { CookieOptions } from '.';\n\nexport const debug = (...args: (string | object | number | boolean)[]) => {\n if (window.location.search.search(/[?&]wmpsm_debug=[1t]/) !== -1) {\n console.info(...args);\n }\n};\n\nexport function cookieHelper(name?: string, value?: string, options?: Partial): string | object | void {\n switch (arguments.length) {\n case 3:\n case 2:\n return set(name, value, options);\n case 1:\n return get(name);\n default:\n return all();\n }\n}\n\n/**\n * Set cookie `name` to `value`.\n */\nfunction set(name: string, value: string, options: Partial) {\n options = options || {};\n let str = encode(name) + '=' + encode(value);\n\n if (options.encode === false) {\n str = name + '=' + value;\n }\n\n if (null == value) options.maxage = -1;\n\n if (options.maxage && !options.expires) {\n options.expires = new Date(+new Date() + options.maxage);\n }\n\n if (options.path) str += '; Path=' + options.path;\n if (options.domain) str += '; Domain=' + options.domain;\n if (options.expires) str += '; Expires=' + options.expires.toUTCString();\n if (options.samesite) str += '; SameSite=' + options.samesite;\n if (options.secure) str += '; Secure';\n\n debug('[COOKIE]: cookie.helper.set()', str, options);\n\n document.cookie = str;\n}\n\n/**\n * Return all cookies.\n */\nfunction all(): object {\n let str: string;\n try {\n str = document.cookie;\n } catch (err) {\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(err.stack || err);\n }\n return {};\n }\n return parse(str);\n}\n\n/**\n * Get cookie `name`.\n */\nfunction get(name: string): string {\n const val = all()[name];\n\n debug(`[COOKIE]: helper.get() - getting ${name} cookie value ${val}`);\n\n return val;\n}\n\n/**\n * Parse cookie `str`.\n */\nfunction parse(str: string): { [key: string]: string } {\n const obj = {};\n const pairs = str.split(/ *; */);\n let pair: string[];\n\n if ('' == pairs[0]) return obj;\n\n for (let i = 0; i < pairs.length; ++i) {\n const cookieName = pairs[i].substr(0, pairs[i].indexOf('='));\n const cookieValue = pairs[i].substr(pairs[i].indexOf('=') + 1);\n obj[decode(cookieName)] = decode(cookieValue);\n }\n\n return obj;\n}\n\nfunction encode(value: string | number | boolean): string {\n try {\n return encodeURIComponent(value);\n } catch (err) {\n // ignore\n }\n}\n\nfunction decode(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch (err) {\n // ignore\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * `navigator.cookieEnabled` cannot detect custom or nuanced cookie-blocking configurations.\n * For example, when blocking cookies via the Advanced Privacy Settings in IE, it always returns true.\n * There can be issues with site-specific exceptions.\n *\n * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here\n */\nexport function cookiesEnabled(): boolean {\n // try..catch because some in situations `document.cookie` is exposed but throws a\n // SecurityError if you try to access it; e.g. documents created from data URIs\n // or in sandboxed iframes (depending on flags/context)\n try {\n // Create test cookie\n let cookie = document.cookie;\n cookie = 'cookietest=1; SameSite=Strict;';\n const result = cookie.indexOf('cookietest=') !== 1;\n // Delete test cookie\n cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';\n return result;\n } catch (err) {\n return false;\n }\n}\n\n/**\n * Checks that localStorage is available, accounting for\n * a `SecurityError` being thrown in Firefox if \"always ask\" is enabled\n * for cookies.\n */\nexport function hasLocalStorage(): boolean {\n try {\n return !!window.localStorage;\n } catch (err) {\n return true;\n }\n}\n\n/**\n * Checks that localStorage is accessible, accounting for private mode in some\n * browsers.\n */\nexport function localStorageAccessible(): boolean {\n const test = '__psm_test__';\n\n if (!hasLocalStorage()) {\n return false;\n }\n try {\n window.localStorage.setItem(test, test);\n window.localStorage.removeItem(test);\n return true;\n } catch (err) {\n return false;\n }\n}\n\n/**\n * Gets the current viewport.\n *\n * Code based on:\n * - http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n * - http://responsejs.com/labs/dimensions/\n */\nexport function detectViewport(): string {\n let alias: Window | HTMLElement = window;\n let modifier = 'inner';\n\n if (!('innerWidth' in window)) {\n modifier = 'client';\n alias = document.documentElement || document.body;\n }\n\n const width = alias[modifier + 'Width'];\n const height = alias[modifier + 'Height'];\n\n if (width >= 0 && height >= 0) {\n return width + 'x' + height;\n } else {\n return null;\n }\n}\n\n/**\n * Gets the total width and height of the current document\n */\nexport function detectDocumentSize(): number[] {\n const de = document.documentElement;\n const be = document.body;\n const bh = be ? Math.max(be.offsetHeight, be.scrollHeight) : 0;\n const w = Math.max(de.clientWidth, de.offsetWidth, de.scrollWidth);\n const h = Math.max(de.clientHeight, de.offsetHeight, de.scrollHeight, bh);\n\n return isNaN(w) || isNaN(h) ? [0, 0] : [w, h];\n}\n\nexport function getScreenResolution(): string {\n return window.screen.width + 'x' + window.screen.height;\n}\n\n/**\n * Extract hostname from URL\n */\nexport function getHostname(url: string): string {\n const matches = new RegExp('^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)').exec(url);\n\n return matches ? matches[1] : url;\n}\n\n/**\n * Get page referrer. In the case of a single-page app,\n * if the URL changes without the page reloading, pass\n * in the old URL. It will be returned unless overriden\n * by a \"refer(r)er\" parameter in the querystring.\n *\n * @param string oldLocation Optional.\n * @return string The referrer\n */\nexport function getReferrer(oldLocation?: string): string {\n let referrer = '';\n\n if (oldLocation) {\n return oldLocation;\n }\n\n try {\n referrer = window.top.document.referrer;\n } catch (err) {\n if (window.parent) {\n try {\n referrer = window.parent.document.referrer;\n } catch (err) {\n referrer = '';\n }\n }\n }\n\n if (referrer === '') {\n referrer = document.referrer;\n }\n\n return referrer;\n}\n\n/**\n * Throttles a function, i.e. do not allow the function to be invoked more than\n * once every X milliseconds.\n *\n * @param callback The function to throttle\n * @param wait The amount of time in milliseconds by which to throttle\n */\nexport function throttle(callback: (..._: T) => void, wait: number): (..._: T) => void {\n let queuedToRun: number | undefined;\n let previouslyRun: number;\n\n return function invokeFn(...args: T) {\n const now = Date.now();\n queuedToRun = window.clearTimeout(queuedToRun) as undefined;\n if (!previouslyRun || now - previouslyRun >= wait) {\n callback(...args);\n previouslyRun = now;\n } else {\n queuedToRun = window.setTimeout(invokeFn.bind(null, ...args), wait - (now - previouslyRun));\n }\n };\n}\n\n/**\n * Checks that a DOM element is not hidden by another element with a higher z-index\n * using document.getElementFromPoint(). To be safe, the center of the expected element is used\n * to account for border radius.\n */\nexport function isElementVisible(el: Element) {\n const rect = el.getBoundingClientRect();\n\n return el.contains(document.elementFromPoint(rect.right - rect.width / 2, rect.bottom - rect.height / 2));\n}\n\n/**\n * Determines the current browser\n */\nexport function setBrowser(): string {\n const userAgent = window.navigator.userAgent;\n\n const isSafari =\n userAgent.indexOf('Safari') > -1 &&\n userAgent.indexOf('Chrome') === -1 &&\n userAgent.indexOf('Chromium') === -1 &&\n userAgent.indexOf('CriOS') === -1 &&\n userAgent.indexOf('EdgiOS') === -1 &&\n userAgent.indexOf('FxiOS') === -1;\n\n const isFirefox =\n (userAgent.indexOf('Firefox') > -1 || userAgent.indexOf('FxiOS') > -1) && userAgent.indexOf('Seamonkey') === -1;\n\n const isChrome =\n (userAgent.indexOf('Chrome') > -1 || userAgent.indexOf('CriOS') > -1) &&\n userAgent.indexOf('Chromium') === -1 &&\n userAgent.indexOf('Edg') === -1 &&\n userAgent.indexOf('OPR') === -1;\n\n const isEdge = userAgent.indexOf('Edg') > -1;\n\n switch (true) {\n case isSafari:\n return 'safari';\n case isFirefox:\n return 'firefox';\n case isChrome:\n return 'chrome';\n case isEdge:\n return 'edge';\n default:\n return 'unknown';\n }\n}\n\n/**\n * Return a value from a name-value pair in a query string\n */\nexport function fromQueryString(field: string, url: string) {\n const match = new RegExp('^[^#]*[?&]' + field + '=([^&#]*)').exec(url);\n if (!match) {\n return null;\n }\n return decodeURIComponent(match[1].replace(/\\+/g, ' '));\n}\n\n/**\n * Add name-value pair to the query string of a URL\n */\nexport function updateQueryString(url: string, name: string, value: string) {\n const initialQsParams = name + '=' + value;\n const hashSplit = url.split('#');\n const qsSplit = hashSplit[0].split('?');\n const beforeQuerystring = qsSplit.shift();\n // Necessary because a querystring may contain multiple question marks\n let querystring = qsSplit.join('?');\n if (!querystring) {\n querystring = initialQsParams;\n } else {\n // Whether this is the first time the link has been decorated\n let initialDecoration = true;\n const qsFields = querystring.split('&');\n for (let i = 0; i < qsFields.length; i++) {\n if (qsFields[i].substr(0, name.length + 1) === name + '=') {\n initialDecoration = false;\n qsFields[i] = initialQsParams;\n querystring = qsFields.join('&');\n break;\n }\n }\n if (initialDecoration) {\n querystring = initialQsParams + '&' + querystring;\n }\n }\n hashSplit[0] = beforeQuerystring + '?' + querystring;\n return hashSplit.join('#');\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Queue from '@segment/localstorage-retry';\nimport { URLS, queueOptions } from './constants';\nimport { hasLocalStorage } from './browser';\nimport { sendRequest } from './sendRequest';\nimport { Psm } from '../web/Psm';\nimport pkg from '../../package.json';\nimport { LogOptions } from '../interfaces';\n\nlet logger: Queue;\nlet environment: string;\nlet values: Psm;\n\nexport function createLogger(psm: Psm) {\n environment = psm.config.psmEnvironment ? psm.config.psmEnvironment.toUpperCase() : 'PROD';\n values = psm;\n\n logger = new Queue('logger', queueOptions, (item: any, done: any) => {\n if (/bot|crawl|spider/i.test(window.navigator.userAgent)) {\n return done(null, {});\n }\n item.ts = new Date().toISOString();\n sendRequest(URLS.logs[environment], {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(item),\n })\n .then((res) => done(null, res))\n .catch((err) => done(err));\n });\n\n logger.start();\n}\n\n/**\n * Not intended to be called directly. Only to be invoked by debug(), warn(), and error()\n * and only exported for testing purposes.\n */\nexport function log(options: LogOptions, level: string) {\n let message: string;\n let stack: string;\n let additionalContext: object;\n\n if (options.err) {\n message = options.err.toString();\n stack = options.err.stack;\n additionalContext = options.err['context'] || {};\n } else {\n message = options.message;\n additionalContext = options.context;\n }\n\n const item = {\n brand: values.config.brand,\n device: {\n type: window.navigator.platform,\n userAgent: window.navigator.userAgent,\n },\n eventName: level,\n eventProperties: {\n logMessage: message,\n method: options.methodName,\n featureFlagValues: values.getFlags(),\n stackTrace: stack,\n },\n eventType: 'log',\n eventTimestamp: new Date().toISOString(),\n library: {\n name: 'PrismJS',\n version: pkg.version,\n initConfig: values.config,\n },\n platform: 'web',\n session: values.session, // cannot update session values here, as it creates an infinite loop!\n wmukid: values.wmukid,\n };\n\n const localStorageDebugFlag = hasLocalStorage() && window.localStorage.getItem('wmpsm_debug') == 'true';\n const queryStringDebugFlag = window.location.search.includes('wmpsm_debug');\n\n if (level !== 'debug') {\n if (localStorageDebugFlag || queryStringDebugFlag || environment === 'AUTOMATED_TEST') {\n if (environment === 'AUTOMATED_TEST') {\n console[level](`[PSM]: ${level}:`, JSON.stringify(item.eventProperties));\n } else {\n console[level](`[PSM]: ${level}:`, item);\n }\n } else {\n if (item.eventProperties.featureFlagValues['doppler-send-logs']) {\n logger.addItem(item);\n }\n }\n } else {\n if (localStorageDebugFlag || queryStringDebugFlag || environment === 'AUTOMATED_TEST') {\n if (environment === 'AUTOMATED_TEST') {\n // console.log(`[PSM]: DEBUG`, JSON.stringify(item.eventProperties));\n } else {\n // console.log(`[PSM]: DEBUG`, item);\n }\n }\n }\n\n return item;\n}\n\nexport function info(options: LogOptions) {\n return log(options, 'info');\n}\n\nexport function debug(options: LogOptions) {\n return log(options, 'debug');\n}\n\nexport function warn(options: LogOptions) {\n return log(options, 'warn');\n}\n\nexport function error(options: LogOptions) {\n return log(options, 'error');\n}\n","import { RequestErrorOptions, RequestOptions } from '../interfaces';\n\nexport class SendRequestError extends Error {\n context: {\n url: string;\n code: number;\n headers: Record;\n method: string;\n };\n\n constructor(options: RequestErrorOptions) {\n const { request, url, opts } = options;\n const message = request.responseText ? request.responseText : 'network failure';\n\n super(message);\n // this.name = 'SendRequestError';\n this.context = {\n url: url,\n code: request.status,\n headers: opts.headers,\n method: opts.method,\n };\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function sendRequest(url: string, options: RequestOptions = {}): Promise {\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n\n request.open(options.method || 'get', url);\n request.onload = () => {\n if (((request.status / 100) | 0) == 2) {\n try {\n // GET requests will return a parseable response\n resolve(JSON.parse(request.responseText));\n } catch (err) {\n // POST requests to Doppler do not include a response, or return an error string\n resolve(request.responseText);\n }\n } else {\n // Non 200 status codes\n reject(new SendRequestError({ request, url, opts: options }));\n }\n };\n request.onerror = () => {\n reject(new SendRequestError({ request, url, opts: options }));\n };\n\n for (const i in options.headers) {\n request.setRequestHeader(i, options.headers[i]);\n }\n\n request.send(options.body || null);\n });\n}\n","import { cookie } from '@turnercode/cdp-cookie';\n\nconst validStringRegExp = /^[1][nNyY-][nNyY-][nNyY-]$/;\nexport class USPrivacyString {\n version: number;\n baseString: string | null;\n\n constructor() {\n this.version = 1;\n this.baseString = null;\n }\n\n getUSPrivacyString(): string {\n return this.baseString;\n }\n\n getVersion(): number {\n return this.version;\n }\n\n setUSPrivacyString(str: string): boolean {\n let didSet = false;\n\n if (validStringRegExp.test(str)) {\n this.baseString = str;\n this.version = Number(str[0]);\n const uspData = {\n version: Number(str[0]),\n uspString: str,\n };\n\n cookie.set('usprivacy', str);\n cookie.set('uspData', uspData);\n didSet = true;\n }\n\n return didSet;\n }\n}\n","import { USPAPICall, USPAPIReturn, TCData, USPData } from '../interfaces';\nimport { USPrivacyString } from './USPrivacyString';\nimport { CCPA_LOCATIONS } from '../utils/constants';\nimport { cookie } from '@turnercode/cdp-cookie';\n\nexport const uspString = new USPrivacyString();\n/**\n * Internal function to find a frame, if it exists\n *\n * @param {string} locator - Locator string to use to find frame\n * @returns {object} - Child frame object if found, else null\n */\nexport function findFrame(locator: string): HTMLElement | HTMLIFrameElement {\n let cmpFrame = null;\n let w: Window;\n\n for (w = window; w; w = w.parent) {\n try {\n if (w.frames && w.frames[locator]) {\n cmpFrame = w;\n break;\n }\n } catch (e) {\n throw new Error(e);\n }\n if (w === window.top) {\n break;\n }\n }\n return cmpFrame;\n}\n\nfunction createIabStub(locatorName: string): void {\n const addFrame = (): boolean => {\n if (!window.frames[locatorName]) {\n if (document.body) {\n const iframe = document.createElement('iframe');\n\n iframe.style.cssText = 'display:none';\n iframe.name = locatorName;\n document.body.appendChild(iframe);\n } else {\n setTimeout(addFrame, 5);\n }\n return true;\n }\n return false;\n };\n\n const uspMsgHandler = (event: MessageEvent) => {\n try {\n const msgIsString = typeof event.data === 'string';\n let i: USPAPICall['__uspapiCall'];\n let json: USPAPICall;\n\n try {\n json = msgIsString ? JSON.parse(event.data) : event.data;\n } catch (e) {\n json = {};\n }\n if (typeof json === 'object' && json !== null && '__uspapiCall' in json) {\n i = json.__uspapiCall;\n window.__uspapi(\n i.command,\n i.version,\n function (retValue: string, success: boolean) {\n const returnMsg: USPAPIReturn = {};\n\n returnMsg.__uspapiReturn = {\n returnValue: retValue,\n success,\n callId: i.callId,\n };\n\n if (event.source instanceof Window) {\n event.source.postMessage(msgIsString ? JSON.stringify(returnMsg) : returnMsg, '*');\n }\n },\n i.parameter\n );\n }\n } catch (e) {\n // TODO - log error ... errorLogger('Privacy', '_uspMsgHandler', e);\n }\n };\n\n const usingUspFrame = findFrame('__uspapiLocator');\n\n /* CCPA IAB handler must always be defined, even in GDPR regions... */\n if (usingUspFrame === null) {\n /* But only for the top frame */\n addFrame();\n window.__uspapi['msgHandler'] = uspMsgHandler;\n window.addEventListener('message', window.__uspapi['msgHandler'], false);\n }\n}\n\nexport function initPrivacy(enabled = true, countryCode: string) {\n const api = {\n isPrivacyEnabled(): boolean {\n return enabled;\n },\n getUSPString(): string {\n return uspString.getUSPrivacyString();\n },\n getUSPData(): USPData {\n return {\n version: uspString.getVersion(),\n uspString: uspString.getUSPrivacyString(),\n };\n },\n setUSPString(str: string): boolean {\n return uspString.setUSPrivacyString(str);\n },\n ccpaShareData(): string {\n if (CCPA_LOCATIONS.includes(countryCode)) {\n uspString.setUSPrivacyString('1YNN');\n }\n return uspString.getUSPrivacyString();\n },\n ccpaDoNotShare(): string {\n if (CCPA_LOCATIONS.includes(countryCode)) {\n uspString.setUSPrivacyString('1YYN');\n }\n return uspString.getUSPrivacyString();\n },\n };\n\n if (enabled) {\n window.__uspapi = function __uspapi(\n command: string,\n version: number,\n callback: (uspData: USPData, success: boolean) => void\n ): void {\n if (command === 'getUSPData' && Number(version) === 1) {\n callback({ version, uspString: uspString.getUSPrivacyString() }, true);\n } else if (command === 'ccpaDoNotShare') {\n callback({ version, uspString: api.ccpaDoNotShare() }, true);\n } else if (command === 'ccpaShareData') {\n callback({ version, uspString: api.ccpaShareData() }, true);\n } else if (command === 'ping') {\n callback({ version, uspapiLoaded: true }, true);\n } else {\n callback(null, false);\n }\n };\n createIabStub('__uspapiLocator');\n\n const str = cookie.get('usprivacy') as string;\n\n if (str) {\n uspString.setUSPrivacyString(str);\n } else if (CCPA_LOCATIONS.includes(countryCode)) {\n uspString.setUSPrivacyString('1YNN');\n } else {\n uspString.setUSPrivacyString('1---');\n }\n\n window.WM = window.WM || {};\n window.WM.PSM = window.WM.PSM || {};\n Object.assign(window.WM?.PSM, api);\n }\n\n return api;\n}\n\nexport function checkOutsideUS(\n categories: Record = {}\n): Promise<{ shouldLoad: boolean; categories: Record[] }> {\n return new Promise((resolve) => {\n if (typeof window.__tcfapi !== 'function') {\n resolve({\n shouldLoad: false,\n categories: [],\n });\n }\n\n const defaultCategories = {\n '1': 'data-store',\n '3': 'ads-person-prof',\n '5': 'content-person-prof',\n '6': 'consent-person',\n '8': 'measure-content',\n '9': 'measure-market',\n '10': 'product-develop',\n ...categories,\n };\n\n window.__tcfapi('getTCData', 2, (tcData: TCData, success: boolean) => {\n if (success && 'purpose' in tcData && 'legitimateInterests' in tcData.purpose) {\n const combined = { ...tcData.purpose.legitimateInterests, ...tcData.purpose.consents };\n const result: Record[] = [];\n let shouldLoad = true;\n\n Object.entries(defaultCategories).forEach(([id, name]) => {\n if (combined[id]) {\n result.push({ [name]: combined[id] });\n } else {\n result.push({ [name]: false });\n shouldLoad = false;\n }\n });\n\n resolve({\n shouldLoad,\n categories: result.concat([\n { 'special-purpose-1': true },\n { 'special-purpose-2': true },\n { 'feature-1': true },\n { 'feature-2': true },\n { 'feature-3': true },\n ]),\n });\n }\n resolve({\n shouldLoad: false,\n categories: [],\n });\n });\n });\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { cookie, findTopDomain } from '@turnercode/cdp-cookie';\nimport { Psm } from '../web/Psm';\nimport {\n cookiesEnabled,\n getReferrer,\n localStorageAccessible,\n detectViewport,\n getScreenResolution,\n detectDocumentSize,\n} from './browser';\nimport pkg from '../../package.json';\nimport { Ids, PayloadCore } from '../interfaces';\nimport { COPPAPrivacyModesEnum } from './constants';\n\nexport function getAdsTransactionId(): string {\n if (typeof window.turner_getTransactionId === 'function') {\n const adsTransactionId = window.turner_getTransactionId();\n return adsTransactionId;\n }\n return null;\n}\n\nexport function getAdsGUID(): string {\n if (cookiesEnabled()) {\n const adsGUID = cookie.get('ug') as string;\n return adsGUID;\n }\n return null;\n}\n\nexport function getMParticleId(): string {\n if (cookiesEnabled()) {\n return (window?.mParticle?.Identity?.getCurrentUser().getMPID() as string) || '';\n } else {\n return null;\n }\n}\n\n/**\n * Adapted from https://github.com/turnercode/digital-ads/blob/develop/src/Modules/Krux/index.js#L33\n */\nexport function getKruxId(): string {\n if (localStorageAccessible()) {\n return window.localStorage.getItem('kxkuid');\n } else if (cookiesEnabled()) {\n return cookie.get('kxkuid') as string;\n } else {\n return null;\n }\n}\n\nexport function getAttUuid(): string {\n if (cookiesEnabled()) {\n const att = cookie.get('firstpartyuid') as { id: string; timestamp: string };\n if (att && typeof att === 'object' && 'id' in att) {\n return att.id;\n } else {\n return null;\n }\n }\n return null;\n}\n\nexport function getOptanonConsentCookie(): string | null {\n let optanonConsentCookie = null;\n if (cookiesEnabled()) {\n optanonConsentCookie = cookie.get('OptanonConsent') as string;\n }\n return optanonConsentCookie;\n}\n\nfunction grabIDFromAMCVCookie(id) {\n const AMCVCookie = cookie.get('AMCV_7FF852E2556756057F000101@AdobeOrg') as string;\n\n if (AMCVCookie) {\n // The AMCV cookie stores ids in the following format: key1 | value1 | key2 | value2\n const AMCVSplit = AMCVCookie.split('|');\n\n // grabs the index of the id key\n const idKeyIndex = AMCVSplit.indexOf(id);\n\n // condition to ensure the id exists on the AMCV cookie, if not skip and return null below\n if (idKeyIndex != -1) {\n // grabs the id value using the id key index as a base and increments by 1 given\n const idValueIndex = idKeyIndex + 1;\n\n return AMCVSplit[idValueIndex];\n }\n }\n return null;\n}\n\nexport function getEcid(): string | null {\n const s_ecid = cookie.get('s_ecid') as string;\n const s_vi = cookie.get('s_vi') as string;\n const ecid = s_ecid ? s_ecid : s_vi ? s_vi : grabIDFromAMCVCookie('MCMID');\n return ecid;\n}\n\nexport function getCnnUid(): string | null {\n let cnnUid = null;\n let zionObj = null;\n if (localStorageAccessible()) {\n zionObj = window.localStorage.getItem('zion.cnn_uid');\n\n if (zionObj) {\n try {\n zionObj = JSON.parse(zionObj);\n cnnUid = zionObj.id;\n } catch {\n if (window.location.search.includes('wmpsm_debug')) {\n // console.error('[PSM] Error parsing zion.cnn_uid to JSON');\n }\n }\n }\n }\n\n return cnnUid;\n}\n\nexport function getConvivaId(): string | null {\n if (localStorageAccessible()) {\n const convivaIdKey = ['Conviva/sdkConfig', 'Conviva.sdkConfig', 'top-player::Conviva.sdkConfig'];\n let clientId = null;\n for (let i = 0; i < convivaIdKey.length; i++) {\n clientId = window.localStorage.getItem(convivaIdKey[i]);\n if (clientId) {\n try {\n const convivaObj = JSON.parse(clientId);\n return convivaObj.clId;\n } catch {\n if (window.location.search.includes('wmpsm_debug')) {\n // console.error('[PSM] Error parsing Conviva ID to JSON');\n }\n }\n }\n }\n }\n return null;\n}\n\nexport function getZionId(): string | null {\n let zionId = null;\n if (window.ZionMessageBus) {\n const zionBus = window.ZionMessageBus.getInstance() as ReturnType;\n const idObjects = zionBus.watching.id_found.messageQueue;\n\n if (idObjects && idObjects instanceof Array) {\n const zaidObject = idObjects.find((idObject) => {\n const message = idObject.message?.type;\n\n if (typeof message === 'string') {\n return message.toLowerCase() === 'zaid';\n }\n });\n zionId = zaidObject ? zaidObject.message.value : null;\n }\n }\n return zionId;\n}\n\n/**\n * Returns the metadata property value as defined by its locations\n *\n * @param locations array of locations to look up\n * @param dynDataObj global object to store dynamic data\n * @returns the metadata property value\n */\nexport function getMetadataPropValue(locations: string[], dynDataObj?: string): string | null {\n let propValue = null;\n if (locations) {\n for (let location of locations) {\n if (typeof location !== 'string') continue;\n if (dynDataObj) location = location.replace(/^data/, dynDataObj);\n const propArr = location.match(/[^.[\\]()]+/g);\n for (let i = 0; i < propArr.length; i++) {\n if (i === 0) propValue = window;\n propValue = propValue[propArr[i]];\n if (typeof propValue === 'function') {\n propValue = propValue();\n }\n if (typeof propValue === 'undefined') {\n propValue = null;\n break;\n }\n }\n if (propValue) return propValue;\n }\n }\n return propValue;\n}\n\n/**\n * Returns page/video metadata properties as defined by its configuration\n *\n * @param metadataConfig configuration to retrieve page/video metadata properties\n * @param type metadata type (page or video)\n * @returns the page/video metadata\n */\nexport function getContentMetadata(metadataConfig: Record, type: string): any {\n const metadata = {};\n metadataConfig &&\n metadataConfig[type] &&\n metadataConfig[type].forEach((prop) => {\n let propValue = getMetadataPropValue(prop.staticLocations);\n if (!propValue) {\n propValue = getMetadataPropValue(prop.dynamicLocations, 'psmPubSubData.' + type);\n }\n metadata[prop.name] = propValue;\n });\n return metadata;\n}\n\nexport const hydratePayload = (psm: Psm, core: PayloadCore) => {\n const totalSize = detectDocumentSize();\n const thirdPartyIds: Partial =\n psm.coppaPrivacyMode === COPPAPrivacyModesEnum.ALL_ID\n ? {\n attuuid: getAttUuid(),\n cdpid: psm.getCDPID(),\n cnnuid: getCnnUid(),\n convivaid: getConvivaId(),\n ecid: getEcid(),\n kruxid: getKruxId(),\n liverampatsid: cookie.get('tok_lr') as string,\n mpid: getMParticleId(),\n tradedeskuid: cookie.get('tok_ttuid') as string,\n wminid: cookie.get('wminid') as string,\n zionid: getZionId(),\n }\n : {};\n\n core.setPlatform(psm.config.platform);\n core.addEntry('companyName', 'WarnerMedia');\n core.setBrand(psm.config.brand);\n core.setSubBrand(psm.config.subBrand);\n core.setProductName(psm.config.productName);\n core.setLibrary({ name: 'PrismJS', version: pkg.version, initConfig: psm.config });\n core.setDevice({\n type: window.navigator.platform,\n userAgent: window.navigator.userAgent,\n totalWidth: totalSize[0],\n totalHeight: totalSize[1],\n screenResolution: getScreenResolution(),\n viewportSize: detectViewport(),\n });\n core.setNavigationProperties({\n url: window.location.href,\n rootDomain: findTopDomain(window.location.href),\n referrer: getReferrer(),\n path: window.location.pathname,\n search: window.location.search,\n title: window.document.title,\n });\n core.setClientResolvedIp(psm.location.ip_address);\n core.setLocation({\n city: psm.location.states[0].cities[0],\n state: psm.location.states[0].state,\n country: psm.location.country,\n zip: psm.location.states[0].zipcodes[0],\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || null,\n locale: window.navigator.language,\n language: window.navigator.language.split('-')[0] || null,\n });\n core.setConsentProperties({\n uspString: cookie.get('usprivacy') as string,\n consentRule: psm.consentRule,\n optanonConsent: getOptanonConsentCookie(),\n psmPrivacyMode: psm.coppaPrivacyMode,\n });\n core.setIABCategories({\n consentCategories: psm.consentCategories,\n });\n core.setWMUKID(psm.wmukid as string);\n core.setEventProperties({\n cookiesEnabled: cookiesEnabled(),\n doNotTrack: window.navigator.doNotTrack || window.doNotTrack ? true : false,\n featureFlagValues: psm.getFlags(),\n cookies: cookie.getAll(),\n automatedTest: psm.config.psmEnvironment === 'AUTOMATED_TEST',\n });\n core.setSessionProperties(psm.session);\n core.setThirdPartyIds(thirdPartyIds);\n core.setContentMetadata({\n page: getContentMetadata(psm.config.contentMetadata, 'page'),\n video: getContentMetadata(psm.config.contentMetadata, 'video'),\n });\n};\n","import { initWMUKID, initCDPID } from './identity';\nimport { cookie } from '@turnercode/cdp-cookie';\nimport { sendRequest } from '../utils/sendRequest';\nimport { URLS } from '../utils/constants';\nimport {\n getAttUuid,\n getCnnUid,\n getConvivaId,\n getEcid,\n getKruxId,\n getOptanonConsentCookie,\n getZionId,\n hydratePayload,\n} from '../utils/hydratePayload';\nimport { info, debug } from '../utils/logger';\nimport { fromQueryString } from '../utils/browser';\nimport {\n CdpidValue,\n PayloadCore,\n AuthTokenResolveRequest,\n AuthTokenResolveResponse,\n AuthServiceTokenObject,\n ConsentProperties,\n} from '../interfaces';\n\nconst parseCookie = (str) =>\n str\n .split(';')\n .map((v) => v.split('='))\n .reduce((acc, v) => {\n acc[decodeURIComponent(v[0].trim())] = decodeURIComponent(v[1].trim());\n return acc;\n }, {});\n\nexport const coreDependencies = (psm) => {\n const global = window as any;\n global.WM = global.WM || {};\n global.WM.PSM = global.WM.PSM || {};\n const psmObj = global.WM.PSM;\n\n return {\n psmObject: psmObj,\n initWMUKID: initWMUKID,\n initCDPID: initCDPID,\n getWMUKID: (inIframe) => {\n if (inIframe) {\n return (parseCookie(document.cookie)['WMUKID_STABLE'] as string) || 'Unknown';\n }\n return (cookie.get('WMUKID_STABLE') as string) || 'Unknown';\n },\n getCDPID: () => {\n const data = cookie.get('CDPID') as CdpidValue;\n\n if (data && typeof data === 'object' && 'cdpId' in data && 'wmukId' in data) {\n return data.cdpId;\n }\n return (data as string) || 'Unknown';\n },\n getConsentProperties: (): ConsentProperties => {\n return {\n uspString: cookie.get('usprivacy') as string,\n consentRule: psm.consentRule,\n optanonConsent: getOptanonConsentCookie() || '',\n psmPrivacyMode: psm.coppaPrivacyMode,\n };\n },\n resolveAuthTokens: async (core: PayloadCore, cookie: any, psm: any) => {\n // Confirm auth service is enabled\n if (!psm.queryFlag('auth-service')) {\n debug({\n message: '[PSM]: auth-service flag is disabled',\n methodName: 'resolveAuthTokens',\n eventType: 'authService',\n });\n return false;\n }\n let newToken = true;\n let tokenUpdated = false;\n\n // Check if previous auth service request happened within 24 hours\n const resolveAuthTimestampCookie = cookie.get('resolveAuthTimestamp') as string | null;\n if (resolveAuthTimestampCookie) {\n const authTimestamp = new Date(resolveAuthTimestampCookie);\n const authLifespan = (Date.now() - authTimestamp.getTime()) / 1000 / 60 / 60; // Get lifespan in hours\n\n if (authLifespan < 24) {\n info({\n message: `Resolve Auth Token lifespan, ${authLifespan}, less than 24 hours`,\n methodName: 'resolveAuthTokens',\n eventType: 'authService',\n });\n return false;\n }\n }\n\n // Generate Liveramp Object\n let liverampObject;\n let zetaObject;\n let brazeObject;\n let cnnAuthObject;\n let tradeDeskObject;\n const tok_lr_cookie = cookie.get('tok_lr') as string;\n const glp_ggw_cookie = cookie.get('glp_ggw') as string;\n const tok_lr2_cookie = cookie.get('tok_lr2') as string;\n\n // Add Liveramp obj once\n if (tok_lr2_cookie) {\n liverampObject = {\n provider: 'Liveramp ATS',\n details: {\n id: tok_lr2_cookie,\n },\n };\n newToken = false;\n tokenUpdated = true;\n }\n\n // Generate Zeta Object\n\n // Confirm Parameters are present\n const bt_ts = fromQueryString('bt_ts', window.location.href);\n const utm_term = fromQueryString('utm_term', window.location.href);\n\n // TODO: move conditional to globals.ts\n if (bt_ts && utm_term) {\n // Check if bt_ts is less than 24 hours old\n const btLifespan = (Date.now() - parseInt(bt_ts)) / 1000 / 60 / 60;\n\n if (btLifespan > 24) {\n info({\n message: `bt_ts Parameter lifespan, ${btLifespan}, greater than 24 hours`,\n methodName: 'resolveAuthTokens',\n eventType: 'authService',\n });\n return false;\n }\n\n zetaObject = {\n provider: 'zeta',\n details: {\n id: utm_term,\n },\n };\n }\n\n // Generate Braze Object\n const primo = fromQueryString('primo', window.location.href);\n if (primo) {\n brazeObject = {\n provider: 'braze',\n details: {\n id: primo,\n },\n };\n }\n\n // Generate CNN Auth Object\n const cnnUid = getCnnUid();\n if (cnnUid) {\n cnnAuthObject = {\n provider: 'cnnAuthentication',\n details: {\n id: cnnUid,\n },\n };\n }\n\n if (glp_ggw_cookie) {\n tradeDeskObject = {\n provider: 'tradedesk',\n details: {\n id: glp_ggw_cookie,\n },\n };\n }\n\n // Delete old tok_lr tokens\n if (tok_lr_cookie) {\n cookie.remove('tok_lr');\n }\n\n // Return if neither LR envelope or Zeta info is valid\n if (!tok_lr2_cookie && (!utm_term || !bt_ts) && !primo && !cnnUid) {\n debug({\n message: '[PSM]: No token information present',\n methodName: 'resolveAuthTokens',\n eventType: 'authService',\n });\n return false;\n }\n\n // Compile all auth objects\n const authObjects = [];\n if (liverampObject?.provider) {\n authObjects.push(liverampObject);\n }\n if (zetaObject?.provider) {\n authObjects.push(zetaObject);\n }\n if (brazeObject?.provider) {\n authObjects.push(brazeObject);\n }\n if (cnnAuthObject?.provider) {\n authObjects.push(cnnAuthObject);\n }\n if (tradeDeskObject?.provider) {\n authObjects.push(tradeDeskObject);\n }\n\n const authTokenRequestBody: AuthTokenResolveRequest = {\n wmukid: psm.getWMUKID(),\n brand: psm.config.brand,\n ids: {\n attuuid: getAttUuid(),\n cdpid: psm.getCDPID(),\n convivaid: getConvivaId(),\n ecid: getEcid(),\n kruxid: getKruxId(),\n wminid: cookie.get('wminid') as string,\n zionid: getZionId(),\n cnnuid: getCnnUid(),\n },\n location: psm.getLocationProperties(),\n consentProperties: { usp: cookie.get('usprivacy') as string },\n authentication: authObjects,\n };\n\n // Make IDR request\n try {\n const authResponse: AuthTokenResolveResponse = await sendRequest(URLS.authSvc[psm.config.psmEnvironment], {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(authTokenRequestBody),\n });\n const { tokens } = authResponse;\n const liverampToken: AuthServiceTokenObject = tokens.filter((token) => token.provider === 'liveramp')[0];\n if (liverampToken) {\n cookie.set('tok_lr', liverampToken.token, {\n expires: new Date(liverampToken.expiration),\n });\n cookie.set('tok_lr2', liverampToken.token, {\n expires: new Date(liverampToken.expiration),\n });\n }\n const tradeDeskToken: AuthServiceTokenObject = tokens.filter((token) => token.provider === 'tradedesk')[0];\n if (tradeDeskToken) {\n cookie.set('glp_ggw', tradeDeskToken.token, {\n expires: new Date(tradeDeskToken.expiration),\n });\n }\n } catch (err) {\n debug({\n err,\n eventType: 'authService',\n methodName: 'resolveAuthTokens',\n });\n }\n\n psm.setSessionProperties();\n hydratePayload(psm, core);\n if (newToken) {\n core.trackTokenEvent('new token', new Date().toISOString(), (data) => {\n if (psm.queryFlag('doppler-send-token-event')) {\n psm.requestQueue.addItem(data);\n psm.resetNewSessionFields();\n }\n });\n }\n\n if (tokenUpdated) {\n core.trackTokenEvent('token updated', new Date().toISOString(), (data) => {\n if (psm.queryFlag('doppler-send-token-event')) {\n psm.requestQueue.addItem(data);\n psm.resetNewSessionFields();\n }\n });\n }\n\n // Set IDR timestamp regardless of IDR response\n cookie.set('resolveAuthTimestamp', new Date());\n\n return true;\n },\n platform: window.navigator.platform,\n };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport Core from '../common/Core';\nimport { coreDependencies } from './dependencies';\nimport { cookie, findTopDomain } from '@turnercode/cdp-cookie';\nimport { v4 as uuid } from 'uuid';\nimport { FeatureFlagClient } from '@turnercode/cdp-feature-flag-client';\nimport Queue from '@segment/localstorage-retry';\nimport {\n PsmConfig,\n SessionProperties,\n NavigationProperties,\n Device,\n Ids,\n IPsm,\n UserConsentEventDetails,\n COPPAPrivacyModesEnum,\n} from '@turnercode/types';\nimport { payloadCore } from './payloadCore';\nimport { CCPA_LOCATIONS, URLS, MAX_SESSION_DURATION, featureFlagDefaults, queueOptions } from '../utils/constants';\nimport { processQueue } from '../utils/processQueue';\nimport { sendRequest } from '../utils/sendRequest';\nimport { psmConstructorProps } from '../common/psm';\nimport { checkOutsideUS } from './privacy';\nimport { createLogger, warn, info, debug, error } from '../utils/logger';\nimport { getReferrer, setBrowser } from '../utils/browser';\nimport { Library, PayloadCore } from '../interfaces';\nimport {\n getAdsGUID,\n getAdsTransactionId,\n getAttUuid,\n getCnnUid,\n getConvivaId,\n getEcid,\n getKruxId,\n getMParticleId,\n getZionId,\n hydratePayload,\n} from '../utils/hydratePayload';\nimport { PSM_SDK_WEB_VERSION } from '../../../prism-module-telemetry/src/common/constants';\n\nexport class Psm extends Core implements IPsm {\n static dependencies: any;\n\n // Request queue for Doppler privacy API\n requestQueue: Queue;\n\n // Feature flag client instance\n ffClient: FeatureFlagClient;\n\n // User's browser -- currently only sets to Safari or Unknown\n browser: string;\n\n core: any;\n\n constructor() {\n super();\n Psm.dependencies = coreDependencies(this);\n psmConstructorProps(this, Psm.dependencies);\n Psm.dependencies.getFlags = this.getFlags.bind(this);\n }\n\n async initPsm(config: PsmConfig): Promise {\n const win = window as any;\n const psmInitialized = win.psmInitialized;\n if (this.ready || psmInitialized) return;\n win.psmInitialized = true;\n this.browser = setBrowser();\n this.config.browser = this.browser;\n this.config = Object.assign(this.config, config);\n createLogger(this);\n\n if (typeof config === 'undefined') {\n const err = new Error('[PSM]: Please provide a valid configuration to initPsm');\n throw err;\n }\n\n const init = async () => {\n const env = config.psmEnvironment.toUpperCase();\n const core: PayloadCore = payloadCore();\n this.core = core;\n\n this.requestQueue = new Queue('prismCE', queueOptions, processQueue(URLS.identity[env]));\n let inIframe = false;\n\n // allowing exception for cnn pages on google amp\n if (window.location !== window.parent.location && config.psmBrandToken !== 'cnnamp') {\n // detecting if Prism is loading from iFrame\n // console.log('[PSM]: Failing to load Prism from iFrame');\n return;\n }\n\n if (config.psmBrandToken === 'cnnamp') {\n inIframe = true;\n }\n\n this.wmukid = Psm.dependencies.initWMUKID(this.coppaPrivacyMode, inIframe);\n\n if (this.coppaPrivacyMode !== COPPAPrivacyModesEnum.ZERO_ID) {\n this.cdpid = await Psm.dependencies.initCDPID(env, this.config.platform);\n\n for (const link of document.links) {\n if (link instanceof HTMLAnchorElement && link.href.includes('hbomax.com/subscribe/plan-picker')) {\n link.addEventListener('click', () => {\n hydratePayload(this, core);\n core.trackPageExit('click', new Date().toISOString(), (data) => {\n (data.navigationProperties as any).destination = link.href;\n data.sentAtTimestamp = new Date().toISOString();\n navigator.sendBeacon(URLS.identity[env], JSON.stringify(data));\n });\n });\n }\n }\n\n // Set sendWMSegs cookie\n this.setSendWMSegs();\n\n // Set sendAuthToken2 cookie\n this.setSendAuth2Token();\n\n // resolve auth token\n Psm.dependencies.resolveAuthTokens(core, cookie, this);\n\n // Publish to ZionMessageBus\n if (window.ZionMessageBus) {\n window.ZionMessageBus.getInstance().publish('id_found', { type: 'wmukid', value: this.wmukid });\n }\n }\n\n // Set session properties with initial page load parameter\n this.setSessionProperties(true);\n\n // Set isInAuthTokenExperiment cookie\n this.setIsInExperiment('isInAuthTokenExperiment');\n\n hydratePayload(this, core);\n\n core.trackIdentityRegistration('identity on page start', new Date().toISOString(), (data) => {\n if (this.queryFlag('doppler-identity-onstart')) {\n this.requestQueue.addItem(data);\n this.resetNewSessionFields();\n }\n\n if (env === 'AUTOMATED_TEST') {\n window.localStorage.setItem('payload-on-start', JSON.stringify(data));\n }\n });\n window.addEventListener('load', () => {\n this.setSessionProperties();\n hydratePayload(this, core);\n core.trackIdentityRegistration('identity on page complete', new Date().toISOString(), (data) => {\n if (this.queryFlag('doppler-identity-oncomplete')) {\n this.requestQueue.addItem(data);\n\n if (env === 'AUTOMATED_TEST') {\n window.localStorage.setItem('payload-on-complete', JSON.stringify(data));\n }\n this.resetNewSessionFields();\n }\n });\n });\n // @ts-ignore\n document.addEventListener('userConsentChanged', (data: { detail: UserConsentEventDetails }) => {\n debug({\n message: 'userConsentChanged event received',\n methodName: 'initPsm',\n eventType: 'privacy',\n context: { eventDetails: data.detail },\n });\n this.setSessionProperties();\n hydratePayload(this, core);\n core.trackConsentUpdated('userConsentChanged', data.detail, new Date().toISOString(), (data) => {\n if (this.queryFlag('doppler-consent-update')) {\n debug({\n message: 'Consent Update event registered',\n methodName: 'initPsm',\n eventType: 'privacy',\n context: { payload: data },\n });\n this.requestQueue.addItem(data);\n this.resetNewSessionFields();\n }\n });\n });\n\n if (this.queryFlag('doppler-pubsub-event')) {\n for (const type in config.topics) {\n config.topics[type].forEach((topic: string) => {\n window.PubSub &&\n window.PubSub.subscribe(topic, (...args: any[]) => {\n let data = typeof args[1] === 'object' ? args[1] : args[0];\n data = Object.keys(data).length < 3 && data.video ? data.video : data;\n window.psmPubSubData = window.psmPubSubData || {};\n window.psmPubSubData[type] = window.psmPubSubData[type] || {};\n Object.assign(window.psmPubSubData[type], data);\n hydratePayload(this, core);\n core.trackPubSub(topic, new Date().toISOString(), (data) => {\n this.requestQueue.addItem(data);\n this.resetNewSessionFields();\n });\n });\n });\n }\n }\n\n // this.privacyQueue.start();\n this.requestQueue.start();\n // this.telemetryQueue.start();\n\n this.ready = true;\n };\n\n this.validateConfig(config);\n\n this.countryCode =\n this.hasProperty('countryCode', config) &&\n typeof config.countryCode !== 'undefined' &&\n this.config.countryCode.length\n ? this.config.countryCode.toUpperCase()\n : '';\n if (CCPA_LOCATIONS.includes(this.countryCode) || this.countryCode === '') {\n try {\n this.config.appId = typeof this.config.appId != 'undefined' || this.config.appId ? this.config.appId : '';\n const locationV2 = await sendRequest(URLS.locateV2, {\n headers: {\n 'app-id': this.config.appId,\n },\n });\n this.location.ip_address = locationV2.ip;\n this.location.country = locationV2.country;\n this.location.country_alpha2 = locationV2.countryAlpha2;\n this.location.country_alpha3 = locationV2.countryAlpha3;\n this.countryCode = this.countryCode === '' ? this.location.country_alpha2 : this.countryCode;\n this.location.states = [\n {\n cities: [locationV2.city],\n counties: [...locationV2.counties],\n state: locationV2.state,\n zipcodes: [...locationV2.zipcodes],\n },\n ];\n this.location.proxy = locationV2.proxy;\n } catch (err) {\n this.location.country = undefined;\n this.location.country_alpha2 = undefined;\n }\n }\n\n try {\n const { shouldLoad, categories } = await checkOutsideUS();\n if (CCPA_LOCATIONS.includes(this.countryCode)) {\n this.consentRule = 'US';\n } else if (shouldLoad && categories.length > 0) {\n this.consentRule = 'GDPR';\n }\n this.consentCategories = categories.reduce((acc, obj) => {\n return {\n ...acc,\n ...obj,\n };\n }, {});\n } catch (err) {\n this.consentCategories = {};\n }\n\n this.initCoppaPrivacyMode();\n\n const clientId = `psmFFClient-${this.config.brand}-${this.config.subBrand}`;\n\n this.ffClient = new FeatureFlagClient({\n configUrl: URLS.featureFlag[config.psmEnvironment.toUpperCase()],\n configRefreshInterval: 60000,\n userTargetingProperties: {\n Platform: ['Web'],\n Brand: [config.brand],\n Browser: this.browser,\n ClientID: clientId,\n CountryCode: this.countryCode,\n },\n clientId: clientId,\n });\n\n try {\n const flags = await this.ffClient.queryAllFeatureFlags();\n this.flags = flags.results;\n if (this.consentRule === 'US' || (this.consentRule === 'GDPR' && this.queryFlag('outside-us-location-check'))) {\n await init();\n }\n } catch (err) {\n console.log('[PSM]: Error encountered during location check', err);\n }\n }\n\n getWMUKID() {\n return Psm.dependencies.getWMUKID();\n }\n\n getCDPID() {\n return Psm.dependencies.getCDPID();\n }\n\n getConsentProperties() {\n return Psm.dependencies.getConsentProperties();\n }\n\n setSendAuth2Token() {\n const sendAuth2Token = this.queryFlag('sendAuthToken2');\n cookie.set('sendAuthToken', sendAuth2Token);\n\n return cookie.set('sendAuthToken2', sendAuth2Token);\n }\n\n setIsInExperiment(name: string) {\n const value = this.queryFlag(name);\n return cookie.set(name, value);\n }\n\n setSendWMSegs() {\n const sendWMSegs = this.queryFlag('sendWMSegs');\n return cookie.set('sendWMSegs', sendWMSegs);\n }\n\n getPageLoadId(sessionStart, initialPageLoad) {\n const pageLoadIdCookie = cookie.get('psmPageLoadId') as string | null;\n const pageLoadIdInt = pageLoadIdCookie && parseInt(pageLoadIdCookie);\n let pageLoadId = pageLoadIdInt;\n if (sessionStart) {\n pageLoadId = 1;\n }\n if (!sessionStart && initialPageLoad && pageLoadIdInt) {\n pageLoadId = pageLoadIdInt + 1;\n }\n return pageLoadId;\n }\n\n setSessionProperties(initialPageLoad = false) {\n const currentTimestamp = new Date();\n let sessionProperties: SessionProperties = {\n isSessionStart: true,\n pageloadid: this.getPageLoadId(true, initialPageLoad),\n psmLastActiveTimestamp: currentTimestamp.toISOString(),\n psmSessionStart: currentTimestamp.toISOString(),\n sessionDuration: 0,\n sessionid: uuid(),\n };\n\n // Get all stored session info\n const prevSessionId = cookie.get('psmSessionId') as string | null;\n const prevSessionStartCookie = cookie.get('psmSessionStart') as string | null;\n const prevLastActiveTimestampCookie = cookie.get('psmLastActiveTimestamp') as string | null;\n\n if (prevSessionId !== null) {\n const prevLastActiveTimestamp = new Date(prevLastActiveTimestampCookie);\n const prevSessionStartTimestamp = new Date(prevSessionStartCookie);\n const timeSinceLastActivity = currentTimestamp.getTime() - prevLastActiveTimestamp.getTime(); // time past in miliseconds\n\n // if session >max time, then create new session\n if (timeSinceLastActivity > MAX_SESSION_DURATION) {\n info({\n message: `[PSM]: Session ${prevSessionId} timed out after ${timeSinceLastActivity / 1000} seconds.`,\n methodName: 'setSessionProperties',\n eventType: 'session',\n });\n sessionProperties = {\n ...sessionProperties,\n previousSession: {\n psmLastActiveTimestamp: prevLastActiveTimestampCookie,\n psmSessionStart: prevSessionStartCookie,\n sessionDuration: (prevLastActiveTimestamp.getTime() - prevSessionStartTimestamp.getTime()) / 1000,\n sessionid: prevSessionId,\n },\n };\n // If session ({ ...flagObj, [curr.flagId]: curr }), {});\n }\n\n getDeviceProperties(): Device {\n return {\n type: Psm.dependencies.platform,\n userAgent: window.navigator.userAgent,\n };\n }\n\n getLibrary(): Library {\n return {\n name: 'Prism JS',\n version: PSM_SDK_WEB_VERSION,\n initConfig: this.config,\n };\n }\n\n getIds(): Ids {\n return {\n attuuid: getAttUuid() || '',\n cdpid: Psm.dependencies.getCDPID(),\n cnnuid: getCnnUid() || '',\n convivaid: getConvivaId() || '',\n ecid: getEcid() || '',\n kruxid: getKruxId() || '',\n liverampatsid: cookie.get('tok_lr') as string,\n wminid: cookie.get('wminid') as string,\n zionid: getZionId() || '',\n };\n }\n\n getNavigationProperties(): NavigationProperties {\n return {\n url: window.location.href,\n rootDomain: findTopDomain(window.location.href),\n referrer: getReferrer(),\n path: window.location.pathname,\n search: window.location.search,\n title: window.document.title,\n };\n }\n\n queryFlag(flagId: string): boolean {\n let flagEnabled: boolean = featureFlagDefaults[flagId] || false;\n try {\n const { enabled } = this.flags.find((flag) => {\n return flag.flagId === flagId;\n });\n\n flagEnabled = enabled;\n } catch (err) {\n warn({\n err,\n methodName: 'queryFlag',\n eventType: 'featureFlagging',\n });\n }\n\n return flagEnabled;\n }\n}\n\nexport default Psm;\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar FunctionPrototype = Function.prototype;\nvar bind = FunctionPrototype.bind;\nvar call = FunctionPrototype.call;\nvar uncurryThis = NATIVE_BIND && bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? function (fn) {\n return fn && uncurryThis(fn);\n} : function (fn) {\n return fn && function () {\n return call.apply(fn, arguments);\n };\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar fails = require('../internals/fails');\nvar classof = require('../internals/classof-raw');\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) == 'String' ? split(it, '') : $Object(it);\n} : $Object;\n","var $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (it == undefined) throw $TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = require('../internals/indexed-object');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n","var check = function (it) {\n return it && it.Math == Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es-x/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof global == 'object' && global) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n","module.exports = false;\n","var global = require('../internals/global');\n\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n","var global = require('../internals/global');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n","var IS_PURE = require('../internals/is-pure');\nvar store = require('../internals/shared-store');\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.23.4',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n","var requireObjectCoercible = require('../internals/require-object-coercible');\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar toObject = require('../internals/to-object');\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es-x/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n","// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\nmodule.exports = function (argument) {\n return typeof argument == 'function';\n};\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\n\nvar aFunction = function (argument) {\n return isCallable(argument) ? argument : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('navigator', 'userAgent') || '';\n","var global = require('../internals/global');\nvar userAgent = require('../internals/engine-user-agent');\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar V8_VERSION = require('../internals/engine-v8-version');\nvar fails = require('../internals/fails');\n\n// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n","/* eslint-disable es-x/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n","var global = require('../internals/global');\nvar shared = require('../internals/shared');\nvar hasOwn = require('../internals/has-own-property');\nvar uid = require('../internals/uid');\nvar NATIVE_SYMBOL = require('../internals/native-symbol');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar WellKnownSymbolsStore = shared('wks');\nvar Symbol = global.Symbol;\nvar symbolFor = Symbol && Symbol['for'];\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {\n var description = 'Symbol.' + name;\n if (NATIVE_SYMBOL && hasOwn(Symbol, name)) {\n WellKnownSymbolsStore[name] = Symbol[name];\n } else if (USE_SYMBOL_AS_UID && symbolFor) {\n WellKnownSymbolsStore[name] = symbolFor(description);\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol(description);\n }\n } return WellKnownSymbolsStore[name];\n};\n","var isCallable = require('../internals/is-callable');\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n","var isObject = require('../internals/is-object');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw $TypeError($String(argument) + ' is not an object');\n};\n","var fails = require('../internals/fails');\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n});\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype != 42;\n});\n","var global = require('../internals/global');\nvar isObject = require('../internals/is-object');\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar fails = require('../internals/fails');\nvar createElement = require('../internals/document-create-element');\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n});\n","var NATIVE_BIND = require('../internals/function-bind-native');\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n","var uncurryThis = require('../internals/function-uncurry-this');\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n","var getBuiltIn = require('../internals/get-built-in');\nvar isCallable = require('../internals/is-callable');\nvar isPrototypeOf = require('../internals/object-is-prototype-of');\nvar USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n","var $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n","var isCallable = require('../internals/is-callable');\nvar tryToString = require('../internals/try-to-string');\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw $TypeError(tryToString(argument) + ' is not a function');\n};\n","var aCallable = require('../internals/a-callable');\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return func == null ? undefined : aCallable(func);\n};\n","var call = require('../internals/function-call');\nvar isCallable = require('../internals/is-callable');\nvar isObject = require('../internals/is-object');\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw $TypeError(\"Can't convert object to primitive value\");\n};\n","var call = require('../internals/function-call');\nvar isObject = require('../internals/is-object');\nvar isSymbol = require('../internals/is-symbol');\nvar getMethod = require('../internals/get-method');\nvar ordinaryToPrimitive = require('../internals/ordinary-to-primitive');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n","var toPrimitive = require('../internals/to-primitive');\nvar isSymbol = require('../internals/is-symbol');\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar anObject = require('../internals/an-object');\nvar toPropertyKey = require('../internals/to-property-key');\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var ceil = Math.ceil;\nvar floor = Math.floor;\n\n// `Math.trunc` method\n// https://tc39.es/ecma262/#sec-math.trunc\n// eslint-disable-next-line es-x/no-math-trunc -- safe\nmodule.exports = Math.trunc || function trunc(x) {\n var n = +x;\n return (n > 0 ? floor : ceil)(n);\n};\n","var trunc = require('../internals/math-trunc');\n\n// `ToIntegerOrInfinity` abstract operation\n// https://tc39.es/ecma262/#sec-tointegerorinfinity\nmodule.exports = function (argument) {\n var number = +argument;\n // eslint-disable-next-line no-self-compare -- NaN check\n return number !== number || number === 0 ? 0 : trunc(number);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar max = Math.max;\nvar min = Math.min;\n\n// Helper for a popular repeating case of the spec:\n// Let integer be ? ToInteger(index).\n// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\nmodule.exports = function (index, length) {\n var integer = toIntegerOrInfinity(index);\n return integer < 0 ? max(integer + length, 0) : min(integer, length);\n};\n","var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');\n\nvar min = Math.min;\n\n// `ToLength` abstract operation\n// https://tc39.es/ecma262/#sec-tolength\nmodule.exports = function (argument) {\n return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n};\n","var toLength = require('../internals/to-length');\n\n// `LengthOfArrayLike` abstract operation\n// https://tc39.es/ecma262/#sec-lengthofarraylike\nmodule.exports = function (obj) {\n return toLength(obj.length);\n};\n","var toIndexedObject = require('../internals/to-indexed-object');\nvar toAbsoluteIndex = require('../internals/to-absolute-index');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\n\n// `Array.prototype.{ indexOf, includes }` methods implementation\nvar createMethod = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = lengthOfArrayLike(O);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod(false)\n};\n","module.exports = {};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar hasOwn = require('../internals/has-own-property');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar indexOf = require('../internals/array-includes').indexOf;\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar push = uncurryThis([].push);\n\nmodule.exports = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (hasOwn(O, key = names[i++])) {\n ~indexOf(result, key) || push(result, key);\n }\n return result;\n};\n","// IE8- don't enum bug keys\nmodule.exports = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n];\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n// eslint-disable-next-line es-x/no-object-keys -- safe\nmodule.exports = Object.keys || function keys(O) {\n return internalObjectKeys(O, enumBugKeys);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');\nvar definePropertyModule = require('../internals/object-define-property');\nvar anObject = require('../internals/an-object');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar objectKeys = require('../internals/object-keys');\n\n// `Object.defineProperties` method\n// https://tc39.es/ecma262/#sec-object.defineproperties\n// eslint-disable-next-line es-x/no-object-defineproperties -- safe\nexports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var props = toIndexedObject(Properties);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);\n return O;\n};\n","var getBuiltIn = require('../internals/get-built-in');\n\nmodule.exports = getBuiltIn('document', 'documentElement');\n","var shared = require('../internals/shared');\nvar uid = require('../internals/uid');\n\nvar keys = shared('keys');\n\nmodule.exports = function (key) {\n return keys[key] || (keys[key] = uid(key));\n};\n","/* global ActiveXObject -- old IE, WSH */\nvar anObject = require('../internals/an-object');\nvar definePropertiesModule = require('../internals/object-define-properties');\nvar enumBugKeys = require('../internals/enum-bug-keys');\nvar hiddenKeys = require('../internals/hidden-keys');\nvar html = require('../internals/html');\nvar documentCreateElement = require('../internals/document-create-element');\nvar sharedKey = require('../internals/shared-key');\n\nvar GT = '>';\nvar LT = '<';\nvar PROTOTYPE = 'prototype';\nvar SCRIPT = 'script';\nvar IE_PROTO = sharedKey('IE_PROTO');\n\nvar EmptyConstructor = function () { /* empty */ };\n\nvar scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n};\n\n// Create object with fake `null` prototype: use ActiveX Object with cleared prototype\nvar NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n};\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n};\n\n// Check for document.domain and active x support\n// No need to use active x approach when document.domain is not set\n// see https://github.com/es-shims/es5-shim/issues/150\n// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n// avoid IE GC bug\nvar activeXDocument;\nvar NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = typeof document != 'undefined'\n ? document.domain && activeXDocument\n ? NullProtoObjectViaActiveX(activeXDocument) // old IE\n : NullProtoObjectViaIFrame()\n : NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n};\n\nhiddenKeys[IE_PROTO] = true;\n\n// `Object.create` method\n// https://tc39.es/ecma262/#sec-object.create\n// eslint-disable-next-line es-x/no-object-create -- safe\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : definePropertiesModule.f(result, Properties);\n};\n","var wellKnownSymbol = require('../internals/well-known-symbol');\nvar create = require('../internals/object-create');\nvar defineProperty = require('../internals/object-define-property').f;\n\nvar UNSCOPABLES = wellKnownSymbol('unscopables');\nvar ArrayPrototype = Array.prototype;\n\n// Array.prototype[@@unscopables]\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\nif (ArrayPrototype[UNSCOPABLES] == undefined) {\n defineProperty(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: create(null)\n });\n}\n\n// add a key to Array.prototype[@@unscopables]\nmodule.exports = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n};\n","module.exports = {};\n","var uncurryThis = require('../internals/function-uncurry-this');\nvar isCallable = require('../internals/is-callable');\nvar store = require('../internals/shared-store');\n\nvar functionToString = uncurryThis(Function.toString);\n\n// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\nif (!isCallable(store.inspectSource)) {\n store.inspectSource = function (it) {\n return functionToString(it);\n };\n}\n\nmodule.exports = store.inspectSource;\n","var global = require('../internals/global');\nvar isCallable = require('../internals/is-callable');\nvar inspectSource = require('../internals/inspect-source');\n\nvar WeakMap = global.WeakMap;\n\nmodule.exports = isCallable(WeakMap) && /native code/.test(inspectSource(WeakMap));\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar definePropertyModule = require('../internals/object-define-property');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var NATIVE_WEAK_MAP = require('../internals/native-weak-map');\nvar global = require('../internals/global');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar isObject = require('../internals/is-object');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar hasOwn = require('../internals/has-own-property');\nvar shared = require('../internals/shared-store');\nvar sharedKey = require('../internals/shared-key');\nvar hiddenKeys = require('../internals/hidden-keys');\n\nvar OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\nvar TypeError = global.TypeError;\nvar WeakMap = global.WeakMap;\nvar set, get, has;\n\nvar enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n};\n\nvar getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n};\n\nif (NATIVE_WEAK_MAP || shared.state) {\n var store = shared.state || (shared.state = new WeakMap());\n var wmget = uncurryThis(store.get);\n var wmhas = uncurryThis(store.has);\n var wmset = uncurryThis(store.set);\n set = function (it, metadata) {\n if (wmhas(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget(store, it) || {};\n };\n has = function (it) {\n return wmhas(store, it);\n };\n} else {\n var STATE = sharedKey('state');\n hiddenKeys[STATE] = true;\n set = function (it, metadata) {\n if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return hasOwn(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return hasOwn(it, STATE);\n };\n}\n\nmodule.exports = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n};\n","'use strict';\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n","var DESCRIPTORS = require('../internals/descriptors');\nvar call = require('../internals/function-call');\nvar propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar toPropertyKey = require('../internals/to-property-key');\nvar hasOwn = require('../internals/has-own-property');\nvar IE8_DOM_DEFINE = require('../internals/ie8-dom-define');\n\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n","var DESCRIPTORS = require('../internals/descriptors');\nvar hasOwn = require('../internals/has-own-property');\n\nvar FunctionPrototype = Function.prototype;\n// eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\nvar getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;\n\nvar EXISTS = hasOwn(FunctionPrototype, 'name');\n// additional protection from minified / mangled / dropped function names\nvar PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';\nvar CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));\n\nmodule.exports = {\n EXISTS: EXISTS,\n PROPER: PROPER,\n CONFIGURABLE: CONFIGURABLE\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar hasOwn = require('../internals/has-own-property');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar CONFIGURABLE_FUNCTION_NAME = require('../internals/function-name').CONFIGURABLE;\nvar inspectSource = require('../internals/inspect-source');\nvar InternalStateModule = require('../internals/internal-state');\n\nvar enforceInternalState = InternalStateModule.enforce;\nvar getInternalState = InternalStateModule.get;\n// eslint-disable-next-line es-x/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nvar CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {\n return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;\n});\n\nvar TEMPLATE = String(String).split('String');\n\nvar makeBuiltIn = module.exports = function (value, name, options) {\n if (String(name).slice(0, 7) === 'Symbol(') {\n name = '[' + String(name).replace(/^Symbol\\(([^)]*)\\)/, '$1') + ']';\n }\n if (options && options.getter) name = 'get ' + name;\n if (options && options.setter) name = 'set ' + name;\n if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {\n if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });\n else value.name = name;\n }\n if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {\n defineProperty(value, 'length', { value: options.arity });\n }\n try {\n if (options && hasOwn(options, 'constructor') && options.constructor) {\n if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });\n // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable\n } else if (value.prototype) value.prototype = undefined;\n } catch (error) { /* empty */ }\n var state = enforceInternalState(value);\n if (!hasOwn(state, 'source')) {\n state.source = TEMPLATE.join(typeof name == 'string' ? name : '');\n } return value;\n};\n\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n// eslint-disable-next-line no-extend-native -- required\nFunction.prototype.toString = makeBuiltIn(function toString() {\n return isCallable(this) && getInternalState(this).source || inspectSource(this);\n}, 'toString');\n","var isCallable = require('../internals/is-callable');\nvar definePropertyModule = require('../internals/object-define-property');\nvar makeBuiltIn = require('../internals/make-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\n\nmodule.exports = function (O, key, value, options) {\n if (!options) options = {};\n var simple = options.enumerable;\n var name = options.name !== undefined ? options.name : key;\n if (isCallable(value)) makeBuiltIn(value, name, options);\n if (options.global) {\n if (simple) O[key] = value;\n else defineGlobalProperty(key, value);\n } else {\n try {\n if (!options.unsafe) delete O[key];\n else if (O[key]) simple = true;\n } catch (error) { /* empty */ }\n if (simple) O[key] = value;\n else definePropertyModule.f(O, key, {\n value: value,\n enumerable: false,\n configurable: !options.nonConfigurable,\n writable: !options.nonWritable\n });\n } return O;\n};\n","var internalObjectKeys = require('../internals/object-keys-internal');\nvar enumBugKeys = require('../internals/enum-bug-keys');\n\nvar hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n// `Object.getOwnPropertyNames` method\n// https://tc39.es/ecma262/#sec-object.getownpropertynames\n// eslint-disable-next-line es-x/no-object-getownpropertynames -- safe\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return internalObjectKeys(O, hiddenKeys);\n};\n","// eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe\nexports.f = Object.getOwnPropertySymbols;\n","var getBuiltIn = require('../internals/get-built-in');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');\nvar getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');\nvar anObject = require('../internals/an-object');\n\nvar concat = uncurryThis([].concat);\n\n// all object keys, includes non-enumerable and symbols\nmodule.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = getOwnPropertyNamesModule.f(anObject(it));\n var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;\n return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;\n};\n","var hasOwn = require('../internals/has-own-property');\nvar ownKeys = require('../internals/own-keys');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar definePropertyModule = require('../internals/object-define-property');\n\nmodule.exports = function (target, source, exceptions) {\n var keys = ownKeys(source);\n var defineProperty = definePropertyModule.f;\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {\n defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n }\n};\n","var fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n","var global = require('../internals/global');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar defineGlobalProperty = require('../internals/define-global-property');\nvar copyConstructorProperties = require('../internals/copy-constructor-properties');\nvar isForced = require('../internals/is-forced');\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global;\n } else if (STATIC) {\n target = global[TARGET] || defineGlobalProperty(TARGET, {});\n } else {\n target = (global[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty == typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n defineBuiltIn(target, key, sourceProperty, options);\n }\n};\n","var fails = require('../internals/fails');\n\nmodule.exports = !fails(function () {\n function F() { /* empty */ }\n F.prototype.constructor = null;\n // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing\n return Object.getPrototypeOf(new F()) !== F.prototype;\n});\n","var hasOwn = require('../internals/has-own-property');\nvar isCallable = require('../internals/is-callable');\nvar toObject = require('../internals/to-object');\nvar sharedKey = require('../internals/shared-key');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar IE_PROTO = sharedKey('IE_PROTO');\nvar $Object = Object;\nvar ObjectPrototype = $Object.prototype;\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n// eslint-disable-next-line es-x/no-object-getprototypeof -- safe\nmodule.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {\n var object = toObject(O);\n if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];\n var constructor = object.constructor;\n if (isCallable(constructor) && object instanceof constructor) {\n return constructor.prototype;\n } return object instanceof $Object ? ObjectPrototype : null;\n};\n","'use strict';\nvar fails = require('../internals/fails');\nvar isCallable = require('../internals/is-callable');\nvar create = require('../internals/object-create');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar IS_PURE = require('../internals/is-pure');\n\nvar ITERATOR = wellKnownSymbol('iterator');\nvar BUGGY_SAFARI_ITERATORS = false;\n\n// `%IteratorPrototype%` object\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-object\nvar IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;\n\n/* eslint-disable es-x/no-array-prototype-keys -- safe */\nif ([].keys) {\n arrayIterator = [].keys();\n // Safari 8 has buggy iterators w/o `next`\n if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;\n else {\n PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));\n if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;\n }\n}\n\nvar NEW_ITERATOR_PROTOTYPE = IteratorPrototype == undefined || fails(function () {\n var test = {};\n // FF44- legacy iterators case\n return IteratorPrototype[ITERATOR].call(test) !== test;\n});\n\nif (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};\nelse if (IS_PURE) IteratorPrototype = create(IteratorPrototype);\n\n// `%IteratorPrototype%[@@iterator]()` method\n// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator\nif (!isCallable(IteratorPrototype[ITERATOR])) {\n defineBuiltIn(IteratorPrototype, ITERATOR, function () {\n return this;\n });\n}\n\nmodule.exports = {\n IteratorPrototype: IteratorPrototype,\n BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS\n};\n","var defineProperty = require('../internals/object-define-property').f;\nvar hasOwn = require('../internals/has-own-property');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\n\nmodule.exports = function (target, TAG, STATIC) {\n if (target && !STATIC) target = target.prototype;\n if (target && !hasOwn(target, TO_STRING_TAG)) {\n defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });\n }\n};\n","'use strict';\nvar IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;\nvar create = require('../internals/object-create');\nvar createPropertyDescriptor = require('../internals/create-property-descriptor');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar Iterators = require('../internals/iterators');\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {\n var TO_STRING_TAG = NAME + ' Iterator';\n IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });\n setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);\n Iterators[TO_STRING_TAG] = returnThis;\n return IteratorConstructor;\n};\n","var isCallable = require('../internals/is-callable');\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n","/* eslint-disable no-proto -- safe */\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar anObject = require('../internals/an-object');\nvar aPossiblePrototype = require('../internals/a-possible-prototype');\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es-x/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n","'use strict';\nvar $ = require('../internals/export');\nvar call = require('../internals/function-call');\nvar IS_PURE = require('../internals/is-pure');\nvar FunctionName = require('../internals/function-name');\nvar isCallable = require('../internals/is-callable');\nvar createIteratorConstructor = require('../internals/create-iterator-constructor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\nvar setPrototypeOf = require('../internals/object-set-prototype-of');\nvar setToStringTag = require('../internals/set-to-string-tag');\nvar createNonEnumerableProperty = require('../internals/create-non-enumerable-property');\nvar defineBuiltIn = require('../internals/define-built-in');\nvar wellKnownSymbol = require('../internals/well-known-symbol');\nvar Iterators = require('../internals/iterators');\nvar IteratorsCore = require('../internals/iterators-core');\n\nvar PROPER_FUNCTION_NAME = FunctionName.PROPER;\nvar CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;\nvar IteratorPrototype = IteratorsCore.IteratorPrototype;\nvar BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;\nvar ITERATOR = wellKnownSymbol('iterator');\nvar KEYS = 'keys';\nvar VALUES = 'values';\nvar ENTRIES = 'entries';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {\n createIteratorConstructor(IteratorConstructor, NAME, next);\n\n var getIterationMethod = function (KIND) {\n if (KIND === DEFAULT && defaultIterator) return defaultIterator;\n if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];\n switch (KIND) {\n case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };\n case VALUES: return function values() { return new IteratorConstructor(this, KIND); };\n case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };\n } return function () { return new IteratorConstructor(this); };\n };\n\n var TO_STRING_TAG = NAME + ' Iterator';\n var INCORRECT_VALUES_NAME = false;\n var IterablePrototype = Iterable.prototype;\n var nativeIterator = IterablePrototype[ITERATOR]\n || IterablePrototype['@@iterator']\n || DEFAULT && IterablePrototype[DEFAULT];\n var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);\n var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;\n var CurrentIteratorPrototype, methods, KEY;\n\n // fix native\n if (anyNativeIterator) {\n CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));\n if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {\n if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {\n if (setPrototypeOf) {\n setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);\n } else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {\n defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);\n }\n }\n // Set @@toStringTag to native iterators\n setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);\n if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;\n }\n }\n\n // fix Array.prototype.{ values, @@iterator }.name in V8 / FF\n if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {\n if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {\n createNonEnumerableProperty(IterablePrototype, 'name', VALUES);\n } else {\n INCORRECT_VALUES_NAME = true;\n defaultIterator = function values() { return call(nativeIterator, this); };\n }\n }\n\n // export additional methods\n if (DEFAULT) {\n methods = {\n values: getIterationMethod(VALUES),\n keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),\n entries: getIterationMethod(ENTRIES)\n };\n if (FORCED) for (KEY in methods) {\n if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {\n defineBuiltIn(IterablePrototype, KEY, methods[KEY]);\n }\n } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);\n }\n\n // define iterator\n if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {\n defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });\n }\n Iterators[NAME] = defaultIterator;\n\n return methods;\n};\n","'use strict';\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar addToUnscopables = require('../internals/add-to-unscopables');\nvar Iterators = require('../internals/iterators');\nvar InternalStateModule = require('../internals/internal-state');\nvar defineProperty = require('../internals/object-define-property').f;\nvar defineIterator = require('../internals/define-iterator');\nvar IS_PURE = require('../internals/is-pure');\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar ARRAY_ITERATOR = 'Array Iterator';\nvar setInternalState = InternalStateModule.set;\nvar getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);\n\n// `Array.prototype.entries` method\n// https://tc39.es/ecma262/#sec-array.prototype.entries\n// `Array.prototype.keys` method\n// https://tc39.es/ecma262/#sec-array.prototype.keys\n// `Array.prototype.values` method\n// https://tc39.es/ecma262/#sec-array.prototype.values\n// `Array.prototype[@@iterator]` method\n// https://tc39.es/ecma262/#sec-array.prototype-@@iterator\n// `CreateArrayIterator` internal method\n// https://tc39.es/ecma262/#sec-createarrayiterator\nmodule.exports = defineIterator(Array, 'Array', function (iterated, kind) {\n setInternalState(this, {\n type: ARRAY_ITERATOR,\n target: toIndexedObject(iterated), // target\n index: 0, // next index\n kind: kind // kind\n });\n// `%ArrayIteratorPrototype%.next` method\n// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next\n}, function () {\n var state = getInternalState(this);\n var target = state.target;\n var kind = state.kind;\n var index = state.index++;\n if (!target || index >= target.length) {\n state.target = undefined;\n return { value: undefined, done: true };\n }\n if (kind == 'keys') return { value: index, done: false };\n if (kind == 'values') return { value: target[index], done: false };\n return { value: [index, target[index]], done: false };\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values%\n// https://tc39.es/ecma262/#sec-createunmappedargumentsobject\n// https://tc39.es/ecma262/#sec-createmappedargumentsobject\nvar values = Iterators.Arguments = Iterators.Array;\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n// V8 ~ Chrome 45- bug\nif (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {\n defineProperty(values, 'name', { value: 'values' });\n} catch (error) { /* empty */ }\n","function getGlobalObject() {\n if (typeof self !== 'undefined') {\n return self;\n }\n if (typeof window !== 'undefined') {\n return window;\n }\n if (typeof global !== 'undefined') {\n return global;\n }\n throw new Error('cannot find the global object');\n}\nexport { getGlobalObject };\n","import { getGlobalObject } from './global-helper';\n\nfunction getCookies(): { [index: string]: string } {\n const cookies = document.cookie;\n const output: { [index: string]: string } = {};\n cookies.split(/\\s*;\\s*/).forEach((pair) => {\n const pairs = pair.split(/\\s*=\\s*/);\n output[pairs[0]] = pairs.splice(1).join('=');\n });\n return output;\n}\n\nfunction getCookiesArray(): Array> {\n const cookies = document.cookie;\n const output: Array> = [];\n cookies.split(/\\s*;\\s*/).forEach((pair) => {\n const pairs = pair.split(/\\s*=\\s*/);\n const cookieObject: { [index: string]: string } = {};\n cookieObject['key'] = pairs[0];\n cookieObject['value'] = pairs[1];\n output.push(cookieObject);\n });\n return output;\n}\n\nfunction getOneCookie(cookieName: string): string | null {\n let fullCookieName: string;\n\n // Check if cookieName is already encoded\n try {\n decodeURIComponent(cookieName);\n // already encoded\n fullCookieName = `${cookieName}=`;\n } catch (e) {\n // needs encoding\n fullCookieName = `${encodeURIComponent(cookieName)}=`;\n }\n\n const cookies = document.cookie.match(`(^|;)\\\\s*${fullCookieName}\\\\s*([^;]+)`);\n\n // decode cookie value on return\n //const cookie = cookies?.pop();\n const cookie = cookies && cookies.pop();\n\n if (cookie) {\n try {\n return JSON.parse(decodeURIComponent(cookie));\n } catch {\n return decodeURIComponent(cookie);\n }\n }\n return null;\n\n //return cookie ? JSON.parse(decodeURIComponent(cookie)) : null;\n}\nfunction setCookie(cookieName: string | number | boolean, cookieObject: string, cookieDomain: string): string | null {\n let cookieString = '';\n if (!cookieName) {\n return null;\n //TODO: once we finalise the logger need to implement below mentioned method.\n //return errorLogger(`Cookie name ${cookieName} invalid`);\n }\n if (!cookieObject) {\n return null;\n //TODO: once we finalise the logger need to implement below mentioned method.\n // return errorLogger(\n // `Cookie object: ${JSON.stringify(cookieObject)} invalid.`\n // );\n }\n const expiration = new Date(Date.now() + 365 * 24 * 60 * 60 * 1000);\n\n if (typeof cookieObject === 'string') {\n cookieString = cookieObject;\n } else {\n cookieString = JSON.stringify(cookieObject);\n }\n if (!cookieDomain) {\n cookieDomain = (getGlobalObject() as unknown as Window).location.hostname;\n }\n\n // cookie token & value need to be encoded before saving\n let cookieContent = `${encodeURIComponent(cookieName)}=${encodeURIComponent(\n cookieString\n )};expires=${expiration.toUTCString()}; samesite=Lax; path=/`;\n if (cookieDomain !== 'localhost') {\n cookieContent = `${cookieContent} ; domain=${cookieDomain}`;\n }\n\n document.cookie = cookieContent;\n return cookieObject;\n}\n\nfunction removeCookie(cookieName: string | number | boolean, cookieDomain: string): void {\n if (!cookieDomain) {\n cookieDomain = (getGlobalObject() as unknown as Window).location.hostname;\n }\n if (cookieName) {\n let cookieContent = `${encodeURIComponent(\n cookieName\n )}=; samesite=Lax; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;`;\n if (cookieDomain !== 'localhost') {\n cookieContent = `${cookieContent} ; domain=${cookieDomain}`;\n }\n document.cookie = cookieContent;\n }\n}\n\nexport { getCookies, getOneCookie, getCookiesArray, setCookie, removeCookie };\n","function getCurrentTime(): string {\n return new Date().toISOString();\n}\nexport { getCurrentTime };\n","export default function(url, options) {\n\toptions = options || {};\n\treturn new Promise( (resolve, reject) => {\n\t\tconst request = new XMLHttpRequest();\n\t\tconst keys = [];\n\t\tconst all = [];\n\t\tconst headers = {};\n\n\t\tconst response = () => ({\n\t\t\tok: (request.status/100|0) == 2,\t\t// 200-299\n\t\t\tstatusText: request.statusText,\n\t\t\tstatus: request.status,\n\t\t\turl: request.responseURL,\n\t\t\ttext: () => Promise.resolve(request.responseText),\n\t\t\tjson: () => Promise.resolve(request.responseText).then(JSON.parse),\n\t\t\tblob: () => Promise.resolve(new Blob([request.response])),\n\t\t\tclone: response,\n\t\t\theaders: {\n\t\t\t\tkeys: () => keys,\n\t\t\t\tentries: () => all,\n\t\t\t\tget: n => headers[n.toLowerCase()],\n\t\t\t\thas: n => n.toLowerCase() in headers\n\t\t\t}\n\t\t});\n\n\t\trequest.open(options.method || 'get', url, true);\n\n\t\trequest.onload = () => {\n\t\t\trequest.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm, (m, key, value) => {\n\t\t\t\tkeys.push(key = key.toLowerCase());\n\t\t\t\tall.push([key, value]);\n\t\t\t\theaders[key] = headers[key] ? `${headers[key]},${value}` : value;\n\t\t\t});\n\t\t\tresolve(response());\n\t\t};\n\n\t\trequest.onerror = reject;\n\n\t\trequest.withCredentials = options.credentials=='include';\n\n\t\tfor (const i in options.headers) {\n\t\t\trequest.setRequestHeader(i, options.headers[i]);\n\t\t}\n\n\t\trequest.send(options.body || null);\n\t});\n}\n","import fetch from 'unfetch';\n\nimport type { MakeRequestParam, MakeResponseParam, RawResponseObject } from './models/http-contract';\n\n/**\n * helper function for http methods ie. GET, POST, etc.\n * @param request\n * @returns request\n */\nasync function makeRequest(request: MakeRequestParam): Promise {\n const headers = {\n 'Content-Type': 'application/json',\n ...request.headers,\n };\n const response = await fetch(request.url, {\n method: request.method,\n headers,\n body: extractRequestPayload(request),\n });\n if (response.ok) {\n return extractResponsePayload(response);\n }\n const error = new Error(response.statusText) as unknown as Record;\n error.response = response;\n return Promise.reject(error);\n}\n\nfunction extractRequestPayload(request: MakeRequestParam): string {\n if (typeof request.payload === 'string') {\n return request.payload;\n } else if (request.payload instanceof String) {\n return request.payload.valueOf();\n } else {\n return JSON.stringify(request.payload);\n }\n}\n\nasync function extractResponsePayload(response: RawResponseObject): Promise {\n let headers = '';\n // Matches the headers structure from XMLHttpRequest.getAllResponseHeaders() used in older versions of Utils\n if (response.headers) {\n response.headers.entries().forEach((entry) => (headers += `${entry[0]}: ${entry[1]}\\r\\n`));\n }\n\n const responsePayload: MakeResponseParam = {\n status: response.status,\n statusText: response.statusText,\n headers: headers,\n data: '', // Matches previous defaulting logic\n };\n\n // Must use .json() to extract payload body\n try {\n const responseJson = await response.json();\n responsePayload.data = responseJson;\n // Must have catch to prevent unhandled exceptions\n } catch (e) {\n new Error(`response.payload cannot be parsed. Failed with error:\\n ${e}`);\n }\n\n return responsePayload;\n}\n\nexport { extractRequestPayload, extractResponsePayload, makeRequest };\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import { v4 as uuidv4 } from 'uuid';\n\nexport function isEnvNode(): boolean {\n try {\n return typeof process !== 'undefined' && typeof process.versions.node !== 'undefined';\n } catch (error) {\n return false;\n }\n}\n\nexport function generateUUID(): string {\n return uuidv4();\n}\n","//@ts-nocheck\nimport { makeRequest } from './http-helper';\nimport { MakeRequestParam, MakeResponseParam } from './models/http-contract';\n\nfunction getGeoLocation(): Promise {\n return new Promise((resolve, reject) => {\n const request: MakeRequestParam = {\n url: 'https://geo.ngtv.io/locate',\n method: 'GET',\n };\n makeRequest(request)\n .then((response: MakeResponseParam) => resolve(response.data))\n .catch((error) => {\n // TODO - need to revisit once logger will finalise\n // errorLogger(error);\n return reject(error);\n });\n });\n}\n\nexport { getGeoLocation };\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { makeRequest } from './http-helper';\nimport { generateUUID } from './ids';\n\nexport interface LogSchema {\n message: {\n version: string;\n level: string;\n wmukid: string;\n appId: string;\n eventId: string;\n timestamp: string;\n brand: string;\n domain: string;\n userAgent: string;\n platform: string;\n scope: string;\n caller: string;\n data: Array>;\n };\n}\n\nexport interface LoggerMetadata {\n version: string;\n appId: string;\n wmukid: string;\n brand: string;\n domain: string;\n}\n\nexport class Logger {\n private url: string;\n private metadata: LoggerMetadata;\n private level: string;\n\n constructor(url: string, metadata: LoggerMetadata) {\n this.url = url;\n this.metadata = metadata;\n this.level = window.location.search.search(/[?&]psm_debug=[1t]/) !== -1 ? 'debug' : 'error';\n }\n\n private transport(\n level: string,\n scope: string,\n caller: string,\n ...args: Array>\n ): void {\n const payload: LogSchema = {\n message: {\n version: this.metadata.version,\n level,\n appId: this.metadata.appId,\n wmukid: this.metadata.wmukid,\n eventId: generateUUID(),\n timestamp: new Date().toISOString(),\n brand: this.metadata.brand,\n domain: this.metadata.domain,\n userAgent: window.navigator.userAgent.toString(),\n platform: 'Web',\n scope,\n caller,\n data: args,\n },\n };\n\n makeRequest({\n url: this.url,\n method: 'POST',\n payload: JSON.stringify(payload, null, 2),\n headers: { type: 'application/json' },\n });\n }\n\n debug(scope: string, caller: string, ...args: Array>): void {\n if (this.level !== 'debug') {\n return;\n }\n console.info('[PSM]', scope, caller, ...args);\n this.transport('debug', scope, caller, ...args);\n }\n\n error(scope: string, caller: string, ...args: Array>): void {\n if (this.level === 'debug') {\n console.error('[PSM]', scope, caller, ...args);\n }\n this.transport('error', scope, caller, ...args);\n }\n}\n","export const APP_USER_ID = 'wmAppUserId';\nexport const FEATURE_FLAG_CONFIG = 'wmFeatureFlagConfig';\nexport const FEATURE_FLAG_USER_ID = 'wmFeatureFlagUserId';\nexport const FEATURE_FLAG_CONFIG_ETAG = 'wmFeatureFlagConfigEtag';\nexport const FEATURE_FLAG_RESULTS = 'wmFeatureFlagResults';\nexport const CONFIG_CACHE_START = 'wmConfigCacheStart';\nexport const CACHE_USED = 'Cache was used due to remote loading failing.';\nexport const FLAG_TYPE_NOT_SUPPORTED = 'A flag with the id was found, but the type is unsupported.';\nexport const FALLBACK_USED_REMOTE_LOAD_FAILED = 'Fallback used because remote config loading failed.';\nexport const FALLBACK_OR_CACHE_USED_REMOTE_LOAD_FAILED = 'Fallback or cache used because remote config loading failed.';\nexport const FALLBACK_USED_FLAG_NOT_IN_REMOTE =\n 'Fallback used because a requested flag was present in it and not the remote.';\nexport const REMOTE_CONFIG_USED_NO_FALLBACK_PRESENT = 'Remote config used because a fallback config is not present.';\nexport const FAILED_TO_READ_CONFIG_FROM_STORAGE =\n 'There was a problem reading the config object from storage, possibly due to invalid config JSON.';\nexport const UNABLE_TO_ACCESS_LOCAL_STORAGE = 'Unable to access localStorage';\nexport const UNABLE_TO_ACCESS_SESSION_STORAGE = 'Unable to access sessionStorage';\nexport const MULTIPLE_INSTANCES_SUPPORT = 'A clientId must be provided for multiple instance support.';\n","/**\n * @module wm-feature-flag-client\n */\n/**\n * Copyright (c) Warner Media. All rights reserved.\n */\nimport { IStorage, IWarning, IWarnings } from './interfaces';\nimport {\n UNABLE_TO_ACCESS_LOCAL_STORAGE,\n UNABLE_TO_ACCESS_SESSION_STORAGE,\n MULTIPLE_INSTANCES_SUPPORT,\n} from './config/constants';\n\nexport class FeatureFlagStorage implements IStorage {\n private storageType: string;\n private clientId: string | undefined;\n private storage: any;\n public warnings: IWarnings;\n constructor(storageType: string, clientId: string | undefined) {\n this.storageType = storageType;\n this.clientId = clientId;\n this.warnings = [];\n if (!this.clientId) {\n const warning: IWarning = { code: 'MULTIPLE_INSTANCES_SUPPORT', message: `${MULTIPLE_INSTANCES_SUPPORT}` };\n this.warnings.push(warning);\n }\n switch (this.storageType) {\n case 'localStorage':\n try {\n this.storage = localStorage;\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_LOCAL_STORAGE',\n message: `${UNABLE_TO_ACCESS_LOCAL_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n break;\n case 'sessionStorage':\n try {\n this.storage = sessionStorage;\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_SESSION_STORAGE',\n message: `${UNABLE_TO_ACCESS_SESSION_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n break;\n case 'inMemory': // todo: implement an in-memory storage option for non-browser env\n default:\n try {\n this.storage = localStorage;\n break;\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_LOCAL_STORAGE',\n message: `${UNABLE_TO_ACCESS_LOCAL_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n }\n }\n\n get(key: string): string | void {\n let storeItem;\n if (typeof Storage === 'undefined') return;\n let storageKey = key;\n if (this.clientId) storageKey = `${storageKey}-${this.clientId}`;\n try {\n storeItem = this.storage.getItem(storageKey);\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_LOCAL_STORAGE',\n message: `${UNABLE_TO_ACCESS_LOCAL_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n return storeItem;\n }\n\n set(key: string, value: string): void {\n if (typeof Storage === 'undefined') return;\n let storageKey = key;\n if (this.clientId) storageKey = `${storageKey}-${this.clientId}`;\n try {\n this.storage.setItem(storageKey, value);\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_LOCAL_STORAGE',\n message: `${UNABLE_TO_ACCESS_LOCAL_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n return;\n }\n\n delete(key: string): void {\n if (typeof Storage === 'undefined') return;\n let storageKey = key;\n if (this.clientId) storageKey = `${storageKey}-${this.clientId}`;\n try {\n this.storage.deleteItem(storageKey);\n } catch (error) {\n const warning: IWarning = {\n code: 'UNABLE_TO_ACCESS_LOCAL_STORAGE',\n message: `${UNABLE_TO_ACCESS_LOCAL_STORAGE}: ${error}`,\n };\n this.warnings.push(warning);\n }\n return;\n }\n}\n","import 'core-js/modules/es.array.iterator';\n\nconst setPolyfills = (): void => {\n /* Object.entries polyfill */\n if (!Object.entries) {\n Object.entries = function (obj: any): any[] {\n const ownProps = Object.keys(obj);\n let i = ownProps.length;\n const resArray = new Array(i); // preallocate the Array\n while (i--) resArray[i] = [ownProps[i], obj[ownProps[i]]];\n\n return resArray;\n };\n }\n\n /* Array.prototype.find polyfill */\n if (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, 'find', {\n value: function (predicate: { call: (arg0: any, arg1: any, arg2: number, arg3: any) => any }) {\n // 1. Let O be ? ToObject(this value).\n if (this == null) {\n throw TypeError('\"this\" is null or not defined');\n }\n\n const o = Object(this);\n\n // 2. Let len be ? ToLength(? Get(O, \"length\")).\n const len = o.length >>> 0;\n\n // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n if (typeof predicate !== 'function') {\n throw TypeError('predicate must be a function');\n }\n\n // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n // eslint-disable-next-line prefer-rest-params\n const thisArg = arguments[1];\n\n // 5. Let k be 0.\n let k = 0;\n\n // 6. Repeat, while k < len\n while (k < len) {\n // a. Let Pk be ! ToString(k).\n // b. Let kValue be ? Get(O, Pk).\n // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n // d. If testResult is true, return kValue.\n const kValue = o[k];\n if (predicate.call(thisArg, kValue, k, o)) {\n return kValue;\n }\n // e. Increase k by 1.\n k++;\n }\n\n // 7. Return undefined.\n return undefined;\n },\n configurable: true,\n writable: true,\n });\n }\n};\n\nexport default setPolyfills;\n","type Message = string | number[] | ArrayBuffer | Uint8Array;\n\ninterface Hasher {\n /**\n * Update hash\n *\n * @param message The message you want to hash.\n */\n update(message: Message): Hasher;\n\n /**\n * Return hash in hex string.\n */\n hex(): string;\n\n /**\n * Return hash in hex string.\n */\n toString(): string;\n\n /**\n * Return hash in ArrayBuffer.\n */\n arrayBuffer(): ArrayBuffer;\n\n /**\n * Return hash in integer array.\n */\n digest(): number[];\n\n /**\n * Return hash in integer array.\n */\n array(): number[];\n}\n\ninterface Hash {\n /**\n * Create a hash object.\n */\n create(): Hasher;\n\n /**\n * Create a hash object and hash message.\n *\n * @param message The message you want to hash.\n */\n update(message: Message): Hasher;\n\n /**\n * Return hash in hex string.\n *\n * @param message The message you want to hash.\n */\n hex(message: Message): string;\n\n /**\n * Return hash in ArrayBuffer.\n *\n * @param message The message you want to hash.\n */\n arrayBuffer(message: Message): ArrayBuffer;\n\n /**\n * Return hash in integer array.\n *\n * @param message The message you want to hash.\n */\n digest(message: Message): number[];\n\n /**\n * Return hash in integer array.\n *\n * @param message The message you want to hash.\n */\n array(message: Message): number[];\n}\n\nconst ERROR = 'input is invalid type';\nconst HEX_CHARS = '0123456789abcdef'.split('');\nconst EXTRA = [-2147483648, 8388608, 32768, 128];\nconst SHIFT = [24, 16, 8, 0];\nconst K = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98,\n 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8,\n 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,\n 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7,\n 0xc67178f2,\n];\nconst OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\nexport class Sha256 implements Hash {\n blocks: number[] = [];\n h0: number;\n h1: number;\n h2: number;\n h3: number;\n h4: number;\n h5: number;\n h6: number;\n h7: number;\n block: number;\n start: number;\n bytes: number;\n hBytes: number;\n finalized: boolean;\n hashed: boolean;\n first: boolean;\n lastByteIndex: number;\n\n constructor() {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n // 256\n this.h0 = 0x6a09e667;\n this.h1 = 0xbb67ae85;\n this.h2 = 0x3c6ef372;\n this.h3 = 0xa54ff53a;\n this.h4 = 0x510e527f;\n this.h5 = 0x9b05688c;\n this.h6 = 0x1f83d9ab;\n this.h7 = 0x5be0cd19;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n create(): Hasher {\n return this;\n }\n\n update(message: Message): Hasher {\n if (this.finalized) {\n return;\n }\n let notString: boolean;\n const type = typeof message;\n if (type !== 'string') {\n if (type === 'object') {\n if (message === null) {\n throw new Error(ERROR);\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (!Array.isArray(message)) {\n if (!ArrayBuffer.isView(message)) {\n throw new Error(ERROR);\n }\n }\n } else {\n throw new Error(ERROR);\n }\n notString = true;\n }\n let code: number,\n index = 0,\n i: number;\n const length = (message as string | Uint8Array).length,\n blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] =\n blocks[1] =\n blocks[2] =\n blocks[3] =\n blocks[4] =\n blocks[5] =\n blocks[6] =\n blocks[7] =\n blocks[8] =\n blocks[9] =\n blocks[10] =\n blocks[11] =\n blocks[12] =\n blocks[13] =\n blocks[14] =\n blocks[15] =\n 0;\n }\n\n if (notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = (message as string).charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | ((message as string).charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += (this.bytes / 4294967296) << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n }\n\n finalize() {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n const blocks = this.blocks,\n i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] =\n blocks[1] =\n blocks[2] =\n blocks[3] =\n blocks[4] =\n blocks[5] =\n blocks[6] =\n blocks[7] =\n blocks[8] =\n blocks[9] =\n blocks[10] =\n blocks[11] =\n blocks[12] =\n blocks[13] =\n blocks[14] =\n blocks[15] =\n 0;\n }\n blocks[14] = (this.hBytes << 3) | (this.bytes >>> 29);\n blocks[15] = this.bytes << 3;\n this.hash();\n }\n\n hash() {\n let a = this.h0,\n b = this.h1,\n c = this.h2,\n d = this.h3,\n e = this.h4,\n f = this.h5,\n g = this.h6,\n h = this.h7,\n j: number,\n s0: number,\n s1: number,\n maj: number,\n t1: number,\n t2: number,\n ch: number,\n ab: number,\n da: number,\n cd: number,\n bc: number;\n const blocks = this.blocks;\n\n for (j = 16; j < 64; ++j) {\n // rightrotate\n t1 = blocks[j - 15];\n s0 = ((t1 >>> 7) | (t1 << 25)) ^ ((t1 >>> 18) | (t1 << 14)) ^ (t1 >>> 3);\n t1 = blocks[j - 2];\n s1 = ((t1 >>> 17) | (t1 << 15)) ^ ((t1 >>> 19) | (t1 << 13)) ^ (t1 >>> 10);\n blocks[j] = (blocks[j - 16] + s0 + blocks[j - 7] + s1) << 0;\n }\n\n bc = b & c;\n for (j = 0; j < 64; j += 4) {\n if (this.first) {\n ab = 704751109;\n t1 = blocks[0] - 210244248;\n h = (t1 - 1521486534) << 0;\n d = (t1 + 143694565) << 0;\n\n this.first = false;\n } else {\n s0 = ((a >>> 2) | (a << 30)) ^ ((a >>> 13) | (a << 19)) ^ ((a >>> 22) | (a << 10));\n s1 = ((e >>> 6) | (e << 26)) ^ ((e >>> 11) | (e << 21)) ^ ((e >>> 25) | (e << 7));\n ab = a & b;\n maj = ab ^ (a & c) ^ bc;\n ch = (e & f) ^ (~e & g);\n t1 = h + s1 + ch + K[j] + blocks[j];\n t2 = s0 + maj;\n h = (d + t1) << 0;\n d = (t1 + t2) << 0;\n }\n s0 = ((d >>> 2) | (d << 30)) ^ ((d >>> 13) | (d << 19)) ^ ((d >>> 22) | (d << 10));\n s1 = ((h >>> 6) | (h << 26)) ^ ((h >>> 11) | (h << 21)) ^ ((h >>> 25) | (h << 7));\n da = d & a;\n maj = da ^ (d & b) ^ ab;\n ch = (h & e) ^ (~h & f);\n t1 = g + s1 + ch + K[j + 1] + blocks[j + 1];\n t2 = s0 + maj;\n g = (c + t1) << 0;\n c = (t1 + t2) << 0;\n s0 = ((c >>> 2) | (c << 30)) ^ ((c >>> 13) | (c << 19)) ^ ((c >>> 22) | (c << 10));\n s1 = ((g >>> 6) | (g << 26)) ^ ((g >>> 11) | (g << 21)) ^ ((g >>> 25) | (g << 7));\n cd = c & d;\n maj = cd ^ (c & a) ^ da;\n ch = (g & h) ^ (~g & e);\n t1 = f + s1 + ch + K[j + 2] + blocks[j + 2];\n t2 = s0 + maj;\n f = (b + t1) << 0;\n b = (t1 + t2) << 0;\n s0 = ((b >>> 2) | (b << 30)) ^ ((b >>> 13) | (b << 19)) ^ ((b >>> 22) | (b << 10));\n s1 = ((f >>> 6) | (f << 26)) ^ ((f >>> 11) | (f << 21)) ^ ((f >>> 25) | (f << 7));\n bc = b & c;\n maj = bc ^ (b & d) ^ cd;\n ch = (f & g) ^ (~f & h);\n t1 = e + s1 + ch + K[j + 3] + blocks[j + 3];\n t2 = s0 + maj;\n e = (a + t1) << 0;\n a = (t1 + t2) << 0;\n }\n\n this.h0 = (this.h0 + a) << 0;\n this.h1 = (this.h1 + b) << 0;\n this.h2 = (this.h2 + c) << 0;\n this.h3 = (this.h3 + d) << 0;\n this.h4 = (this.h4 + e) << 0;\n this.h5 = (this.h5 + f) << 0;\n this.h6 = (this.h6 + g) << 0;\n this.h7 = (this.h7 + h) << 0;\n }\n\n hex() {\n this.finalize();\n\n const h0 = this.h0,\n h1 = this.h1,\n h2 = this.h2,\n h3 = this.h3,\n h4 = this.h4,\n h5 = this.h5,\n h6 = this.h6,\n h7 = this.h7;\n\n let hex =\n HEX_CHARS[(h0 >> 28) & 0x0f] +\n HEX_CHARS[(h0 >> 24) & 0x0f] +\n HEX_CHARS[(h0 >> 20) & 0x0f] +\n HEX_CHARS[(h0 >> 16) & 0x0f] +\n HEX_CHARS[(h0 >> 12) & 0x0f] +\n HEX_CHARS[(h0 >> 8) & 0x0f] +\n HEX_CHARS[(h0 >> 4) & 0x0f] +\n HEX_CHARS[h0 & 0x0f] +\n HEX_CHARS[(h1 >> 28) & 0x0f] +\n HEX_CHARS[(h1 >> 24) & 0x0f] +\n HEX_CHARS[(h1 >> 20) & 0x0f] +\n HEX_CHARS[(h1 >> 16) & 0x0f] +\n HEX_CHARS[(h1 >> 12) & 0x0f] +\n HEX_CHARS[(h1 >> 8) & 0x0f] +\n HEX_CHARS[(h1 >> 4) & 0x0f] +\n HEX_CHARS[h1 & 0x0f] +\n HEX_CHARS[(h2 >> 28) & 0x0f] +\n HEX_CHARS[(h2 >> 24) & 0x0f] +\n HEX_CHARS[(h2 >> 20) & 0x0f] +\n HEX_CHARS[(h2 >> 16) & 0x0f] +\n HEX_CHARS[(h2 >> 12) & 0x0f] +\n HEX_CHARS[(h2 >> 8) & 0x0f] +\n HEX_CHARS[(h2 >> 4) & 0x0f] +\n HEX_CHARS[h2 & 0x0f] +\n HEX_CHARS[(h3 >> 28) & 0x0f] +\n HEX_CHARS[(h3 >> 24) & 0x0f] +\n HEX_CHARS[(h3 >> 20) & 0x0f] +\n HEX_CHARS[(h3 >> 16) & 0x0f] +\n HEX_CHARS[(h3 >> 12) & 0x0f] +\n HEX_CHARS[(h3 >> 8) & 0x0f] +\n HEX_CHARS[(h3 >> 4) & 0x0f] +\n HEX_CHARS[h3 & 0x0f] +\n HEX_CHARS[(h4 >> 28) & 0x0f] +\n HEX_CHARS[(h4 >> 24) & 0x0f] +\n HEX_CHARS[(h4 >> 20) & 0x0f] +\n HEX_CHARS[(h4 >> 16) & 0x0f] +\n HEX_CHARS[(h4 >> 12) & 0x0f] +\n HEX_CHARS[(h4 >> 8) & 0x0f] +\n HEX_CHARS[(h4 >> 4) & 0x0f] +\n HEX_CHARS[h4 & 0x0f] +\n HEX_CHARS[(h5 >> 28) & 0x0f] +\n HEX_CHARS[(h5 >> 24) & 0x0f] +\n HEX_CHARS[(h5 >> 20) & 0x0f] +\n HEX_CHARS[(h5 >> 16) & 0x0f] +\n HEX_CHARS[(h5 >> 12) & 0x0f] +\n HEX_CHARS[(h5 >> 8) & 0x0f] +\n HEX_CHARS[(h5 >> 4) & 0x0f] +\n HEX_CHARS[h5 & 0x0f] +\n HEX_CHARS[(h6 >> 28) & 0x0f] +\n HEX_CHARS[(h6 >> 24) & 0x0f] +\n HEX_CHARS[(h6 >> 20) & 0x0f] +\n HEX_CHARS[(h6 >> 16) & 0x0f] +\n HEX_CHARS[(h6 >> 12) & 0x0f] +\n HEX_CHARS[(h6 >> 8) & 0x0f] +\n HEX_CHARS[(h6 >> 4) & 0x0f] +\n HEX_CHARS[h6 & 0x0f];\n hex +=\n HEX_CHARS[(h7 >> 28) & 0x0f] +\n HEX_CHARS[(h7 >> 24) & 0x0f] +\n HEX_CHARS[(h7 >> 20) & 0x0f] +\n HEX_CHARS[(h7 >> 16) & 0x0f] +\n HEX_CHARS[(h7 >> 12) & 0x0f] +\n HEX_CHARS[(h7 >> 8) & 0x0f] +\n HEX_CHARS[(h7 >> 4) & 0x0f] +\n HEX_CHARS[h7 & 0x0f];\n\n return hex;\n }\n\n toString() {\n return this.hex();\n }\n\n digest() {\n this.finalize();\n\n const h0 = this.h0,\n h1 = this.h1,\n h2 = this.h2,\n h3 = this.h3,\n h4 = this.h4,\n h5 = this.h5,\n h6 = this.h6,\n h7 = this.h7;\n\n const arr = [\n (h0 >> 24) & 0xff,\n (h0 >> 16) & 0xff,\n (h0 >> 8) & 0xff,\n h0 & 0xff,\n (h1 >> 24) & 0xff,\n (h1 >> 16) & 0xff,\n (h1 >> 8) & 0xff,\n h1 & 0xff,\n (h2 >> 24) & 0xff,\n (h2 >> 16) & 0xff,\n (h2 >> 8) & 0xff,\n h2 & 0xff,\n (h3 >> 24) & 0xff,\n (h3 >> 16) & 0xff,\n (h3 >> 8) & 0xff,\n h3 & 0xff,\n (h4 >> 24) & 0xff,\n (h4 >> 16) & 0xff,\n (h4 >> 8) & 0xff,\n h4 & 0xff,\n (h5 >> 24) & 0xff,\n (h5 >> 16) & 0xff,\n (h5 >> 8) & 0xff,\n h5 & 0xff,\n (h6 >> 24) & 0xff,\n (h6 >> 16) & 0xff,\n (h6 >> 8) & 0xff,\n h6 & 0xff,\n ];\n arr.push((h7 >> 24) & 0xff, (h7 >> 16) & 0xff, (h7 >> 8) & 0xff, h7 & 0xff);\n\n return arr;\n }\n\n array() {\n return this.digest();\n }\n\n arrayBuffer() {\n this.finalize();\n\n const buffer = new ArrayBuffer(32);\n const dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n dataView.setUint32(20, this.h5);\n dataView.setUint32(24, this.h6);\n dataView.setUint32(28, this.h7);\n\n return buffer;\n }\n}\n","/**\n * @module wm-feature-flag-client\n */\n/**\n * Copyright (c) Warner Media. All rights reserved.\n */\nimport { generateUUID, makeRequest } from '@turnercode/cdp-utils-js';\n\nimport config from './config/base.json';\nimport {\n APP_USER_ID,\n CACHE_USED,\n CONFIG_CACHE_START,\n FAILED_TO_READ_CONFIG_FROM_STORAGE,\n FALLBACK_OR_CACHE_USED_REMOTE_LOAD_FAILED,\n FALLBACK_USED_FLAG_NOT_IN_REMOTE,\n FALLBACK_USED_REMOTE_LOAD_FAILED,\n FEATURE_FLAG_CONFIG,\n FEATURE_FLAG_CONFIG_ETAG,\n FEATURE_FLAG_RESULTS,\n FEATURE_FLAG_USER_ID,\n REMOTE_CONFIG_USED_NO_FALLBACK_PRESENT,\n} from './config/constants';\nimport { FeatureFlagStorage } from './featureFlagStorage';\nimport {\n ICohortConfig,\n IConfig,\n IContext,\n IFeatureFlagClient,\n IFlag,\n ILoadConfigResponse,\n IQueryAllResponse,\n IQueryFeatureResult,\n IWarning,\n IWarnings,\n} from './interfaces';\nimport setPolyfills from './polyfills';\nimport { Sha256 } from './utils/Sha256';\n\n/* set polyfills for IE11 support */\nsetPolyfills();\n\n/**\n * Provides core feature flag querying functionality for\n * determining which features are enabled for a specific user.\n * @implements {IFlagFlagClient}\n */\nexport class FeatureFlagClient implements IFeatureFlagClient {\n private config?: IConfig;\n private configRefreshIntervalDefault: number;\n private context: IContext;\n private fallbackConfig?: IConfig;\n private featureFlagUserId: string;\n private initialized: boolean;\n private libraryLanguage: string;\n private storage: FeatureFlagStorage;\n private quickInit: boolean;\n private globalWarnings: IWarnings;\n /**\n * Creates a new instance of the [FeatureFlagClient] class.\n * @param context The conext object containing the userId and config data\n * @param config Optional. The feature flag config file.\n *\n * @remarks\n * The config file at location context.configUrl will be fetched from AWS S3 unless a config file is provided\n */\n constructor(context: IContext, fallbackConfig?: IConfig, quickInit = false) {\n if (!context) throw new Error('Please provide a context object to the constructor.');\n if (!context.configUrl && !fallbackConfig)\n throw new Error('Please provide either a config url or a valid config object.');\n this.config = undefined;\n this.configRefreshIntervalDefault = config.minimumPollFrequencySeconds;\n this.context = context;\n this.fallbackConfig = fallbackConfig;\n this.featureFlagUserId = '';\n this.libraryLanguage = config.ffLibraryLanguage;\n this.initialized = false;\n this.quickInit = quickInit;\n const storageType = context && context.storageType ? context.storageType : '';\n this.storage = new FeatureFlagStorage(storageType, context.clientId);\n this.globalWarnings = [];\n }\n\n /**\n * Creates a hash of the userId and saltKey (using browser'crypto / msCrytpo' api)\n * @param userId The userId used to create the hash\n * @param salt The salt used to create the hash\n * @return {string} hash\n */\n private createHash(userId: string, salt: string): string {\n const sha256 = new Sha256();\n const hash = sha256.create();\n hash.update(`${userId}${salt}`);\n const hashValue = hash.hex();\n return hashValue;\n }\n\n /**\n * Creates a user id\n * @return {string} userId\n */\n private createUserId(): string {\n const userId = generateUUID();\n return userId;\n }\n\n /**\n * Creates a 2-digit string from the hash to be used as an index for\n * comparing against the rollout percentage of the feature to determine\n * whether the feature is enabled or disabled\n * @param hash\n * @return {string} 2-digit segment of the hash\n */\n private getUserFeatureIndex(hash: string): string {\n const hashSegment = parseInt(hash.substring(0, 10), 16);\n return hashSegment.toString().slice(-2);\n }\n\n /**\n * Initialization code to ensure that the userId, config and ffLibraryLanguage are set\n * @return {void}\n */\n async init(): Promise {\n const initWarnings: IWarnings = [];\n const {\n config,\n fallbackConfig,\n initialized,\n featureFlagUserId,\n libraryLanguage,\n storage,\n configRefreshIntervalDefault,\n quickInit,\n } = this;\n const { configUrl, userId, configRefreshInterval } = this.context;\n // get user-defined refresh interval or use default if none provided\n const cfgRefreshInterval =\n typeof configRefreshInterval !== 'undefined' ? configRefreshInterval : configRefreshIntervalDefault;\n const cacheIsExpired = this.checkConfigCacheExpiry(cfgRefreshInterval);\n\n // initialization steps:\n // 1. ensure we have feature flag configuration. first look for config in storage,\n // otherwise fetch it from configUrl location\n if (!config || cacheIsExpired) {\n const configFromStorage = storage.get(FEATURE_FLAG_CONFIG);\n try {\n if (configFromStorage) this.config = JSON.parse(configFromStorage);\n } catch (error) {\n const warning: IWarning = {\n code: 'FAILED_TO_READ_CONFIG_FROM_STORAGE',\n message: FAILED_TO_READ_CONFIG_FROM_STORAGE,\n };\n initWarnings.push(warning);\n }\n if (!configFromStorage || cacheIsExpired) {\n // check if config file has changed before downloading\n // by populating 'If-None-Match' header with value of the previous etag\n // get config file (if it has been updated), save it in storage along with new eTag\n if (configUrl) {\n // set fallback config as default in case remote fetch fails\n if (!cacheIsExpired && fallbackConfig) this.updateConfig(fallbackConfig);\n let prevETag = storage.get(FEATURE_FLAG_CONFIG_ETAG) || '-1';\n // if no config in storage, fetch file\n prevETag = !configFromStorage ? '-1' : prevETag;\n try {\n if (quickInit && fallbackConfig) {\n if (!configFromStorage) this.updateConfig(fallbackConfig);\n this.loadAndSetRemoteConfig(configUrl, prevETag);\n return initWarnings;\n }\n if (quickInit && !fallbackConfig) {\n const warning: IWarning = {\n code: 'REMOTE_CONFIG_USED_NO_FALLBACK_PRESENT',\n message: REMOTE_CONFIG_USED_NO_FALLBACK_PRESENT,\n };\n initWarnings.push(warning);\n }\n await this.loadAndSetRemoteConfig(configUrl, prevETag);\n } catch (error) {\n // log and continue to use cached file version, or set fallbackConfig if available\n if (configFromStorage || fallbackConfig) {\n this.setNoNewConfigWarning();\n } else {\n throw new Error(`Failed to load config file - no config url or default config provided. ${error}`);\n }\n }\n } else {\n // use fallbackConfig if there is no configUrl\n if (!fallbackConfig)\n throw new Error('Failed to load config file - no config url or default config provided.');\n this.updateConfig(fallbackConfig);\n }\n }\n }\n\n // pass through if instance already initialized\n if (initialized) return initWarnings;\n\n // 2. ensure we have a userId. if it's not in the context object, check storage.\n if (!userId) {\n const userId = storage.get(APP_USER_ID);\n if (userId) this.context.userId = userId;\n } else {\n storage.set(APP_USER_ID, userId);\n }\n\n // 3. ensure we have a featureFlagUserId. if there isn't one in storage, create one.\n if (!featureFlagUserId) {\n const ffUserId = storage.get(FEATURE_FLAG_USER_ID);\n if (ffUserId) this.featureFlagUserId = ffUserId;\n if (!ffUserId) {\n this.featureFlagUserId = this.createUserId();\n storage.set(FEATURE_FLAG_USER_ID, this.featureFlagUserId);\n }\n }\n\n // 4. ensure that the ffLibraryLanguage property is set\n if (\n !this.context.userTargetingProperties ||\n (this.context.userTargetingProperties && !this.context.userTargetingProperties.ffLibraryLanguage)\n ) {\n const userTargetingProperties = {\n ffLibraryLanguage: libraryLanguage,\n };\n this.updateContext(undefined, userTargetingProperties);\n }\n\n this.initialized = true;\n return initWarnings;\n }\n\n /**\n * Determine whether the flag config has been cached longer than the desired interval\n * @param interval The maximum time (in ms) to cache the config file before fetching a new copy\n * @return {boolean}\n */\n checkConfigCacheExpiry(interval: number): boolean {\n const { storage } = this;\n const now = new Date();\n let expired = false;\n const setIntervalStart = (timestamp: string): void => storage.set(CONFIG_CACHE_START, timestamp);\n // check for a timestamp in browser storage\n const configCacheStartSerialized = storage.get(CONFIG_CACHE_START);\n // if there's no timestamp in browser storage, create one\n if (!configCacheStartSerialized) {\n const now = new Date();\n setIntervalStart(JSON.stringify(now.getTime()));\n }\n const configCacheStart = configCacheStartSerialized ? JSON.parse(configCacheStartSerialized) : now.getTime();\n\n const cacheTimeElapsed = now.getTime() - configCacheStart; // in ms\n expired = cacheTimeElapsed > interval ? true : false;\n if (expired === true) {\n const now = new Date();\n setIntervalStart(JSON.stringify(now.getTime()));\n }\n return expired;\n }\n\n async isFeatureEnabled(flagName: string): Promise {\n return (await this.queryFeatureFlag(flagName)).enabled;\n }\n\n /**\n * When remote fetch of config file fails (or is unchanged - 304)\n * set warning and appropriate backup config\n * @param interval The maximum time (in ms) to cache the config file before fetching a new copy\n * @return {void}\n */\n private setNoNewConfigWarning(): void {\n const { fallbackConfig, storage } = this;\n const configFromStorage = storage.get(FEATURE_FLAG_CONFIG);\n // if there is no new config file version available, handle the 304 error\n // log and continue to use cached file version, or set fallbackConfig if available\n if (configFromStorage) {\n const warning: IWarning = { code: 'CACHE_USED', message: CACHE_USED };\n this.globalWarnings.push(warning);\n } else if (!configFromStorage && fallbackConfig) {\n this.globalWarnings.push({ code: 'FALLBACK_USED_REMOTE_LOAD_FAILED', message: CACHE_USED });\n this.updateConfig(fallbackConfig);\n }\n }\n\n // Taken directly from the FF Client repo codebase\n parseHeaders(responseHeaders: string): any {\n const responseHeadersArray = responseHeaders.split('\\r\\n');\n return responseHeadersArray.reduce(function (acc, current) {\n const parts = current.split(': ');\n // @ts-ignore\n acc[parts[0]] = parts[1];\n return acc;\n }, {});\n }\n\n async loadAndSetRemoteConfig(configUrl: string, prevETag: string): Promise {\n try {\n const response = await this.loadConfig(configUrl, prevETag);\n if (response) {\n this.config = response.data ? response.data : this.config;\n if (!response.data) {\n this.globalWarnings.push({\n code: 'FALLBACK_USED_REMOTE_LOAD_FAILED',\n message: FALLBACK_USED_REMOTE_LOAD_FAILED,\n });\n }\n\n let eTag = response.headers && response.headers.etag ? response.headers.etag : '';\n\n if (response.headers && typeof response.headers === 'string') {\n const responseHeaders = this.parseHeaders(response.headers);\n eTag = responseHeaders.etag;\n }\n\n if (eTag) this.storage.set(FEATURE_FLAG_CONFIG_ETAG, eTag);\n // store config to temp storage\n this.storage.set(FEATURE_FLAG_CONFIG, JSON.stringify(this.config));\n }\n } catch (err) {\n // remote fetch unsuccessfull, go to cache (or fallback)\n this.globalWarnings.push({\n code: 'FALLBACK_OR_CACHE_USED_REMOTE_LOAD_FAILED',\n message: FALLBACK_OR_CACHE_USED_REMOTE_LOAD_FAILED,\n });\n this.setNoNewConfigWarning();\n }\n }\n\n /**\n * Loads the config file from the configUrl location\n * @param configUrl Uri for the desired feature flag config file\n * @param eTag The value of the etag header from the previous request, default to -1\n */\n async loadConfig(configUrl: string, eTag = '-1'): Promise {\n let response;\n const url = `${configUrl}?version=${config.ffLibraryVersionCode}`;\n const headers = { 'If-None-Match': eTag };\n const options = {\n headers: headers,\n };\n try {\n response = await makeRequest({ url, method: 'GET', headers });\n } catch (error) {\n throw new Error(`Failed to fetch config file: ${error}`);\n }\n\n return response as Promise;\n }\n\n /**\n * Update the config object\n * @param config A feature flag configuration file\n */\n updateConfig(config: IConfig): void {\n this.config = config;\n this.storage.set(FEATURE_FLAG_CONFIG, JSON.stringify(config));\n }\n\n /**\n * Update the context object\n * @param userId a string id\n * @param userTargeting an object conatining user cohort targeting criteria\n * @param replaceAllTargeting a boolean the determine where or not to replace all targeting\n */\n updateContext(userId?: string, userTargeting?: any, replaceAllTargeting?: boolean): void {\n const newContext = { ...this.context };\n if (userId) newContext.userId = userId;\n if (replaceAllTargeting) {\n newContext.userTargetingProperties = userTargeting;\n } else {\n const mergedTargetingProperties = { ...newContext.userTargetingProperties, ...userTargeting };\n newContext.userTargetingProperties = mergedTargetingProperties;\n }\n this.context = newContext;\n }\n\n /**\n * Add Storage warnings to FeatureFlagClient.warnings array\n * @param warnings An array of IWarning objects\n */\n addStorageWarnings = (): IWarnings => {\n const addStorageWarningsWarnings: IWarnings = [];\n if (this.storage.warnings && this.storage.warnings.length > 0) {\n this.storage.warnings.map((warning) => {\n addStorageWarningsWarnings.push(warning);\n });\n }\n return addStorageWarningsWarnings;\n };\n\n /**\n * Convert targeting keys and values to lower case\n * @param targetingProperties\n */\n targetingPropsToLowerCase = (targetingProperties: any): any => {\n return Object.entries(targetingProperties).reduce((acc: any, [key, value]) => {\n let valueLowerCase;\n if (typeof value === 'string') valueLowerCase = value.toLowerCase();\n if (Array.isArray(value)) {\n valueLowerCase = value.map((entry): string => entry.toLowerCase());\n }\n acc[key.toLowerCase()] = valueLowerCase;\n return acc;\n }, {});\n };\n\n /**\n * Determine which cohort configuration from the feature config file to use\n * @param context The conext object containing the userId and config data\n * @param cohortConfigs cohort configuration objects from the feature config file\n * @return {ICohortConfig}\n */\n getCohortConfig(context: IContext, cohortConfigs: ICohortConfig[]): ICohortConfig {\n // set a defaut cohort config in case no matches found\n const defaultIdType = context.userId ? 'appUserId' : 'ffUserId';\n let cohortConfig: ICohortConfig = { rolloutValue: '-1', cohortPriority: 1, stickinessProperty: defaultIdType };\n\n // sort by 'cohortPriority' property\n const cohortConfigsSorted = [...cohortConfigs];\n cohortConfigsSorted.sort((a, b) => (a.cohortPriority > b.cohortPriority ? 1 : -1));\n\n // transform context keys to lower case for case insensitive matching\n const clientTargetingProperties = this.targetingPropsToLowerCase(context.userTargetingProperties);\n\n // identify cohort config to use by validating all 'cohortCriteria' fields\n const matchedCohortConfig = cohortConfigsSorted.find((cohortConfig) => {\n let matchDetected = false;\n // if there is no userId provider and the stickinessProperty specifies userId - do not match\n if (!context.userId && cohortConfig.stickinessProperty === 'appUserId') return false;\n // if no cohort criteria is present, consider the cohort a match\n if (!cohortConfig.cohortCriteria || cohortConfig.cohortCriteria.length < 1) return true;\n const cohortFields = cohortConfig.cohortCriteria;\n // iterate through cohort criteria\n for (let i = 0; i < cohortFields.length; i++) {\n let { requiredFieldName } = cohortFields[i];\n const { requiredFieldValues } = cohortFields[i];\n requiredFieldName = requiredFieldName.toLowerCase();\n // if at least one cohort field value is present in context object, consider the filed validated\n const cohortFieldFoundInContext = requiredFieldValues.some((fieldValue: string) => {\n fieldValue = fieldValue.toLowerCase();\n // match if fieldValue is empty string and property is absent in clientTargetingProperties\n // eslint-disable-next-line no-prototype-builtins\n if (!clientTargetingProperties.hasOwnProperty(requiredFieldName) && fieldValue === '') return true;\n // check for both string and array values of the matching property\n if (typeof clientTargetingProperties[requiredFieldName] === 'string')\n return clientTargetingProperties[requiredFieldName] === fieldValue;\n if (Array.isArray(clientTargetingProperties[requiredFieldName])) {\n return clientTargetingProperties[requiredFieldName].some(\n (contextValue: string) => contextValue === fieldValue\n );\n }\n });\n matchDetected = cohortFieldFoundInContext;\n if (!matchDetected) break;\n }\n return matchDetected;\n });\n\n // overwrite default cohort config if a matching config was found\n if (matchedCohortConfig) cohortConfig = { ...matchedCohortConfig };\n return cohortConfig;\n }\n\n /**\n * set feature flag results into storage\n * @param results Either a single result (object) or an array of results\n * @return {IQueryFeatureResult[]}\n */\n cacheFlagResults(results: IQueryFeatureResult | IQueryFeatureResult[]): IQueryFeatureResult[] {\n const { storage } = this;\n let prevResults = [],\n prevResultsReduced = [],\n newResults: IQueryFeatureResult[] = [];\n\n // populate newResults array from results argument\n if (Array.isArray(results)) {\n newResults = results ? [...results] : [];\n } else {\n newResults.push(results);\n }\n\n // get cached flag values from storage and deserialize\n const storedResultsString = storage.get(FEATURE_FLAG_RESULTS);\n const storedResults = storedResultsString ? JSON.parse(storedResultsString) : [];\n prevResults = [...storedResults];\n\n // filter out duplicates from prevResults\n if (prevResults.length > 0) {\n prevResultsReduced = prevResults.reduce((accumulator, currentValue) => {\n if (newResults.find((result) => result.flagId === currentValue.flagId)) {\n return accumulator;\n } else {\n return [...accumulator, currentValue];\n }\n }, []);\n }\n\n // merge previous and new results and set into storage\n const mergedResults = [...prevResultsReduced, ...newResults];\n storage.set(FEATURE_FLAG_RESULTS, JSON.stringify(mergedResults));\n return mergedResults;\n }\n\n /**\n * check if the flag's enabled value has changed compared with the cached value\n * @param result The processed new flag to compare\n * @return {boolean}\n */\n checkIfFlagUpdated(result: IQueryFeatureResult): boolean {\n const { storage } = this;\n\n // get cached flag values from storage and deserialize\n const storedResultsString = storage.get(FEATURE_FLAG_RESULTS);\n const storedResults = storedResultsString ? JSON.parse(storedResultsString) : [];\n\n // if no results in storage, return true (ie, flag updated)\n if (storedResults.length < 1) return true;\n\n // compare values of stored flag and fetched flag\n const prevFlag = storedResults.find((prevFlag: IQueryFeatureResult) => prevFlag.flagId === result.flagId);\n\n if (!prevFlag) return true;\n const hasFlagChanged = prevFlag.enabled !== result.enabled;\n return hasFlagChanged;\n }\n\n /**\n * Checks whether or not a given feature is enabled for a specific user\n * @param flagId\n * @param isQueryAll is this part of a queryAllFeatureFlags call?\n * @return {IQueryFeatureResult} response object containing feature name, 'enabled' boolean and userId\n */\n async queryFeatureFlag(flagId: string, isQueryAll = false): Promise {\n const { context, fallbackConfig } = this;\n let enabled = false,\n flagConfig: any,\n flagName: string,\n hashId,\n operationalId,\n userFeatureIndex: string,\n userIdType = 'appUserId',\n warnings: IWarnings = [];\n\n const mergeWarnings = (arrayToMerge: IWarnings): IWarnings => {\n const globalWarnings = isQueryAll ? [] : this.globalWarnings;\n return warnings.concat(arrayToMerge, globalWarnings);\n };\n\n const getFlagConfig = (config: IConfig, flagId: string): IFlag | undefined => {\n return config.flags.find((flag: IFlag) => flag.id === flagId);\n };\n\n const getFallbackConfig = (fallbackConfig: IConfig, flagId: string): IQueryFeatureResult | undefined => {\n flagConfig = getFlagConfig(fallbackConfig, flagId);\n if (flagConfig) {\n const addStorageWarningsWarnings = this.addStorageWarnings();\n warnings = mergeWarnings(addStorageWarningsWarnings);\n\n const result = {\n clientId: context.clientId,\n flagId: flagConfig.id,\n flagName: flagConfig.name ? flagConfig.name : undefined,\n enabled: flagConfig.defaultValue,\n updatedSinceLastQuery: true,\n warnings: warnings,\n };\n result.updatedSinceLastQuery = this.checkIfFlagUpdated(result);\n this.cacheFlagResults(result);\n return result;\n }\n };\n\n try {\n const initWwarnings = await this.init();\n warnings = initWwarnings.concat(warnings);\n operationalId = this.context.userId ? this.context.userId : undefined;\n if (!this.config || !this.config.flags)\n throw new Error('Operation failed - no config file or invalid config file detected.');\n\n // get the feature flag configuration matching the feature name provided\n flagConfig = getFlagConfig(this.config, flagId);\n\n // if the flag is not found, try again using the fallbackConfig, if available\n if (!flagConfig) {\n if (fallbackConfig) {\n const response = getFallbackConfig(fallbackConfig, flagId);\n if (response) {\n const warning: IWarning = {\n code: 'FALLBACK_USED_FLAG_NOT_IN_REMOTE',\n message: FALLBACK_USED_FLAG_NOT_IN_REMOTE,\n };\n warnings.push(warning);\n return response;\n }\n }\n // if there's still no match throw and error\n throw new Error('Flag not found');\n }\n\n const { cohorts, defaultValue, name, type } = flagConfig;\n\n if (type && type.toLowerCase() !== 'boolean' && !isQueryAll) throw new Error('Flag not found');\n\n // if there are no cohorts (ie fallbackConfig) return early\n if (!cohorts || cohorts.length < 1) {\n const addStorageWarningsWarnings = this.addStorageWarnings();\n warnings = mergeWarnings(addStorageWarningsWarnings);\n\n const result = {\n clientId: context.clientId,\n flagId: flagConfig.id,\n flagName: name,\n enabled: flagConfig.defaultValue,\n updatedSinceLastQuery: true,\n warnings: warnings,\n };\n\n result.updatedSinceLastQuery = this.checkIfFlagUpdated(result);\n this.cacheFlagResults(result);\n\n return result;\n }\n\n flagName = name;\n\n // determine the feature's cohort config\n const cohortConfig = this.getCohortConfig(context, cohorts);\n let { rolloutValue } = cohortConfig;\n const { stickinessProperty } = cohortConfig;\n rolloutValue = rolloutValue || '0';\n\n // create the hash and 'user feature index' (derived from hash)\n const saltKey = flagConfig.id;\n hashId = this.context.userId ? this.context.userId : undefined;\n\n // use the ffUserId if specified by cohort config\n if (stickinessProperty === 'ffUserId') {\n operationalId = this.featureFlagUserId;\n userIdType = 'ffUserId';\n hashId = operationalId;\n }\n\n const hash = hashId ? this.createHash(hashId, saltKey) : undefined;\n\n userFeatureIndex = hash ? this.getUserFeatureIndex(hash) : '-1';\n enabled = parseInt(userFeatureIndex, 10) < parseInt(rolloutValue, 10);\n\n // determine whether or not flag is enabled for the given user\n // attempt to use the defaultValue if either there is no cohort config match or an invalid userFeatureIndex\n if (parseInt(rolloutValue, 10) < 0 || parseInt(userFeatureIndex, 10) < 0 || parseInt(userFeatureIndex, 10) > 99) {\n if (typeof defaultValue === 'undefined') {\n // try fallback config\n if (fallbackConfig) {\n const response = getFallbackConfig(fallbackConfig, flagId);\n if (response) return response;\n // if there's still no match throw and error\n throw new Error('Flag not found');\n }\n throw new Error('Unable to determine flag default value');\n }\n enabled = defaultValue;\n }\n } catch (error) {\n throw new Error(`Failed to query feature flag: ${error}`);\n }\n\n const addStorageWarningsWarnings = this.addStorageWarnings();\n warnings = mergeWarnings(addStorageWarningsWarnings);\n\n const result = {\n flagId: flagId,\n flagName: flagName,\n enabled: enabled,\n updatedSinceLastQuery: true,\n clientId: context.clientId,\n userId: operationalId,\n userIdType: userIdType,\n warnings: warnings,\n };\n\n result.updatedSinceLastQuery = this.checkIfFlagUpdated(result);\n\n this.cacheFlagResults(result);\n\n return result;\n }\n\n /**\n * Checks availability of all features for a specific user\n * @return {IQueryFeatureResult[]} array of feature flag data objects\n */\n async queryAllFeatureFlags(): Promise {\n await this.init();\n const { config } = this;\n if (!config || !config.flags) throw new Error('No config file or invalid config file detected.');\n\n const featureFlagResponse: IQueryAllResponse = {\n anyFlagsUpdatedSinceLastQuery: false,\n globalWarnings: this.globalWarnings,\n results: [],\n };\n\n const promises = config.flags.map(async (flag: IFlag) => {\n const featureFlagData: IQueryFeatureResult = await this.queryFeatureFlag(flag.id, true);\n if (featureFlagData.updatedSinceLastQuery === true) featureFlagResponse.anyFlagsUpdatedSinceLastQuery = true;\n featureFlagResponse.results.push(featureFlagData);\n });\n\n return Promise.all(promises).then(() => featureFlagResponse);\n }\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { v4 as uuid } from 'uuid';\nimport {\n AdsProperties,\n ConsentProperties,\n ContentMetadata,\n Device,\n EventProperties,\n IABConsentCategories,\n Ids,\n Library,\n LocationProperties,\n NavigationProperties,\n PayloadCore,\n PayloadData,\n PayloadMap,\n SessionProperties,\n Timestamp,\n UserConsentEventDetails,\n} from '../interfaces';\nimport { payloadBuilder } from '../utils/payloadBuilder';\n\n/**\n * Generate or transform a timestamp.\n *\n * @param timestamp optional timestamp number (UNIX time) or date string\n */\nfunction getTimestamp(timestamp?: Timestamp): string {\n if (timestamp == null || timestamp == undefined) {\n return new Date().toISOString();\n }\n return new Date(timestamp).toISOString();\n}\n\n/**\n * Returns a copy of a JSON object with null and undefined properties removed\n *\n * @param payload JSON object to clean\n * @returns A cleaned copy of the JSON object\n */\nexport const removeEmptyProperties = (payload: PayloadMap): PayloadMap => {\n const result = {};\n\n if (Array.isArray(payload)) {\n return payload;\n } else {\n Object.entries(payload).forEach(([key, value]) => {\n if (value === Object(value)) {\n result[key] = removeEmptyProperties(value as PayloadMap);\n } else if (value !== null && value !== undefined) {\n result[key] = payload[key];\n }\n });\n }\n\n return result;\n};\n\n/**\n * Prism Core factory. This factory function returns a core API object, common to all Prism modules.\n *\n * @param callback Function to be applied to every payload fragment\n * @returns the Prism core\n */\nexport function payloadCore(callback?: (data: PayloadData) => void): PayloadCore {\n // Map of key-value pairs that get added to every payload\n const payloadMap: PayloadMap = {};\n\n /**\n * Set a persistent key-value pair to be added to every payload\n * @param key Field name\n * @param value Field value\n */\n const addEntry = (key: string, value: string | boolean | object | number) => {\n payloadMap[key] = value;\n };\n\n /**\n * Gets called by every \"track\" method\n *\n * @param data The payload\n * @param timestamp Timestamp of the event\n * @param cb A callback function triggered after an event is tracked\n */\n const track = (data: PayloadData, timestamp?: Timestamp, cb?: (data: PayloadMap) => void): PayloadData => {\n // add all common pairs\n data.addMap(removeEmptyProperties(payloadMap));\n // generate an event timestamp\n data.add('eventTimestamp', getTimestamp(timestamp));\n // generate an event ID\n data.add('eventId', uuid());\n\n if (typeof callback === 'function') {\n callback(data);\n }\n\n try {\n cb && cb(data.build());\n } catch (err) {\n console.warn('[PSM]: error running custom callback');\n }\n\n return data;\n };\n\n return {\n addEntry,\n\n setPlatform(platform: string): void {\n addEntry('platform', platform);\n },\n\n setBrand(brand: string): void {\n addEntry('brand', brand);\n },\n\n setSubBrand(brand: string): void {\n addEntry('subBrand', brand);\n },\n\n setProductName(productName: string): void {\n addEntry('productName', productName);\n },\n\n setWMUKID(wmukid: string): void {\n addEntry('wmukid', wmukid);\n },\n\n setThirdPartyIds(ids: Partial): void {\n addEntry('ids', ids);\n },\n\n setDevice(device: Device): void {\n addEntry('device', device);\n },\n\n setNavigationProperties(props: NavigationProperties): void {\n addEntry('navigationProperties', props);\n },\n\n setClientResolvedIp(ip: string): void {\n addEntry('clientResolvedIp', ip);\n },\n\n setLocation(location: LocationProperties): void {\n addEntry('location', location);\n },\n\n setConsentProperties(props: ConsentProperties): void {\n addEntry('consentProperties', props);\n },\n\n setIABCategories(props: IABConsentCategories): void {\n addEntry('iabConsentCategories', props);\n },\n\n setLibrary(library: Library): void {\n const win = window as any;\n const wmObject = win.WM as any;\n const wmuc = wmObject?.UserConsent as any;\n let wmucLibrary = null;\n\n if (wmuc) {\n wmucLibrary = {\n version: wmuc.getVersion(),\n usingPsm: wmuc.usingPSM(),\n initConfig: wmObject.UserConsentConfig,\n };\n }\n\n addEntry('library', { wmucLibrary, ...library });\n },\n\n setEventProperties(props: EventProperties): void {\n addEntry('eventProperties', props);\n },\n\n setSessionProperties(props: SessionProperties): void {\n addEntry('session', props);\n },\n\n setContentMetadata(metadata: ContentMetadata): void {\n addEntry('contentMetadata', metadata);\n },\n\n trackAppLoad(ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'telemetry');\n data.add('eventName', 'appLoad');\n\n return track(data, ts, cb);\n },\n\n trackPubSub(eventName: string, ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n const eventProperties = {\n eventTrigger: 'pubsub',\n };\n\n data.add('eventType', 'telemetry');\n data.add('eventName', eventName);\n addEntry('eventProperties', eventProperties);\n\n return track(data, ts, cb);\n },\n\n trackIdentityRegistration(eventName: string, ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'identity');\n data.add('eventName', eventName);\n\n return track(data, ts, cb);\n },\n\n trackTokenEvent(eventName: string, ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'token');\n data.add('eventName', eventName);\n\n return track(data, ts, cb);\n },\n\n trackConsentUpdated(\n eventTrigger: string,\n eventDetails?: UserConsentEventDetails,\n ts?: Timestamp,\n cb?: (payload: PayloadMap) => void\n ): PayloadData {\n const data = payloadBuilder();\n const eventProperties = {\n eventTrigger,\n uspString: eventDetails?.usp,\n region: eventDetails?.region,\n };\n\n data.add('eventType', 'privacy');\n data.add('eventName', 'consent update');\n addEntry('eventProperties', eventProperties);\n\n return track(data, ts, cb);\n },\n\n trackConsentGranted(ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'privacy');\n data.add('eventName', 'ccpaShareData');\n\n return track(data, ts, cb);\n },\n\n trackConsentWithdrawn(ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'privacy');\n data.add('eventName', 'ccpaShareData');\n\n return track(data, ts, cb);\n },\n\n trackPageExit(eventTrigger: string, ts?: Timestamp, cb?: (payload: PayloadMap) => void): PayloadData {\n const data = payloadBuilder();\n\n data.add('eventType', 'telemetry');\n data.add('eventName', 'pageExit');\n data.add('eventTrigger', eventTrigger);\n\n return track(data, ts, cb);\n },\n };\n}\n","import { PayloadData, PayloadMap } from '../interfaces';\n\nexport function isJson(property: unknown): boolean {\n const record = property as Record | null | undefined;\n return (\n typeof record !== 'undefined' &&\n record !== null &&\n (record.constructor === {}.constructor || record.constructor === [].constructor)\n );\n}\n\nexport function isNonEmptyJson(property: Record): boolean {\n if (!isJson(property)) {\n return false;\n }\n for (const key in property) {\n if (Object.prototype.hasOwnProperty.call(property, key)) {\n return true;\n }\n }\n return false;\n}\n\nexport function payloadBuilder(): PayloadData {\n const payload: PayloadMap = {};\n\n const add = (key: string, value?: unknown): void => {\n if (value != null && value !== '') {\n // null also checks undefined\n payload[key] = value;\n }\n };\n\n const addMap = (map: PayloadMap): void => {\n for (const key in map) {\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n add(key, map[key]);\n }\n }\n };\n\n const addJson = (key: string, json?: Record): void => {\n if (json && isNonEmptyJson(json)) {\n const str = JSON.stringify(json);\n add(key, str);\n }\n };\n\n const build = (): PayloadMap => {\n return payload;\n };\n\n return {\n add,\n addMap,\n addJson,\n build,\n };\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { sendRequest } from './sendRequest';\nimport { debug } from './logger';\n\nexport function processQueue(url: string) {\n return (item: any, done: any) => {\n const bots = ['bot', 'crawl', 'spider'];\n const reg = new RegExp(bots.join('|'), 'i');\n if (reg.test(window.navigator.userAgent)) {\n return done(null, {});\n }\n item.sentAtTimestamp = new Date().toISOString();\n sendRequest(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(item),\n })\n .then((res) => done(null, res))\n .catch((err) => {\n debug({\n err,\n methodName: 'sendRequest',\n eventType: item.eventType || 'queue',\n });\n done(err);\n });\n };\n}\n","export const psmConstructorProps = (psm, dependencies: any): void => {\n const psmObject = dependencies.psmObject;\n psmObject.initPsm = psm.initPsm.bind(psm);\n psmObject.getVersion = psm.getVersion.bind(psm);\n psmObject.getWMUKID = dependencies.getWMUKID.bind(psm);\n psmObject.getCDPID = dependencies.getCDPID.bind(psm);\n psmObject.getConfig = psm.getConfig.bind(psm);\n psmObject.getConsentProperties = dependencies.getConsentProperties.bind(psm);\n psmObject.getBrand = psm.getBrand.bind(psm);\n psmObject.getBrandToken = psm.getBrandToken.bind(psm);\n psmObject.getSubBrand = psm.getSubBrand.bind(psm);\n psmObject.getCoppaPrivacyMode = psm.getCoppaPrivacyMode.bind(psm);\n psmObject.getDeviceProperties = psm.getDeviceProperties.bind(psm);\n psmObject.getIds = psm.getIds.bind(psm);\n psmObject.getLibrary = psm.getLibrary.bind(psm);\n psmObject.getLocationProperties = psm.getLocationProperties.bind(psm);\n psmObject.getDeviceProperties = psm.getDeviceProperties.bind(psm);\n psmObject.getNavigationProperties = psm.getNavigationProperties.bind(psm);\n psmObject.getSessionProperties = psm.getSessionProperties.bind(psm);\n psmObject.isDopplerIdentityOnStartEnabled = () => psm.queryFlag('doppler-identity-onstart');\n psmObject.isDopplerIdentityOnCompleteEnabled = () => psm.queryFlag('doppler-identity-oncomplete');\n psmObject.isDopplerPrivacyEnabled = () => psm.queryFlag('doppler-privacy');\n psmObject.isDopplerTelemetryEnabled = () => psm.queryFlag('doppler-telemetry');\n if (psm.setUspData) {\n psmObject.setUspData = psm.setUspData.bind(psm);\n psmObject.getUspBoolean = psm.getUspBoolean.bind(psm);\n psmObject.getUspString = psm.getUspString.bind(psm);\n psmObject.getComScoreFromUsp = psm.getComScoreFromUsp.bind(psm);\n psmObject.getUspData = psm.getUspData.bind(psm);\n }\n};\n","// TODO: make sure these match the constants used in /scripts/bundleConfig.js\nexport const CDN_CONFIG_PATH = 'https://lightning.warnermediacdn.com/cdp/psm/schemas/video/qos/'\nexport const FILES_CDN = 'program-map.top-2.json device-map.json event-map.top-2.json config.json'\nexport const PSM_CONFIG_PATH = 'https://lightning.warnermediacdn.com/cdp/psm/brands'\nexport const DEFAULT_API_PATH = 'https://dev.video.wmcdp.io/v1/vid'\nexport const PSM_MGR_POLL_INTERVAL_MIN = '5'\nexport const INVALID_VALIDATOR_LABEL = 'psmClientInvalid:'\nexport const SCHEMA_VERSION_NUMBER = '1.1.5'\nexport const INITIAL_SCHEMA_VERSION_NUMBER = '0.0.0'\nexport const POLLING_VERSION_PARAM = 'psm_test_polling_version_override'\nexport const LOCALSTORAGE_ACTIVE_CONFIG_KEY = 'psmTelConfig'\nexport const DEFAULT_TIMER_INTERVAL = 30\nexport const ENDING_EVENTS_CONFIG = ['contentCompleted', 'contentEnded']\nexport const CLEAN_STREAMTYPE_CHECK_EVENTS = [\"contentBeginning\", \"mediaStarting\", \"contentEnded\"]\nexport const PSM_SDK_RN_VERSION = '3.0.0'\nexport const PSM_SDK_WEB_VERSION = '3.2.1'\nexport const LOCALSTORAGE_WMUKID_KEY = 'WMUKID';\n","import { Psm } from './Psm';\n\nconst psm = new Psm();\n\nexport * from './Psm';\n"],"mappings":"2gCAKe,aAAe,CAE5B,GAAI,CAAC,IAGH,IAAkB,MAAO,QAAW,KAAe,OAAO,iBAAmB,OAAO,gBAAgB,KAAK,MAAM,GAAK,MAAO,UAAa,KAAe,MAAO,UAAS,iBAAoB,YAAc,SAAS,gBAAgB,KAAK,QAAQ,EAE3O,CAAC,IACH,KAAM,IAAI,OAAM,0G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