diff --git a/.gitignore b/.gitignore index 2610381ea..83d92ef42 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,4 @@ package-lock.json build.sh publish.sh coverage/** -dist/ __tests__/prodsdk.js diff --git a/README.md b/README.md index f02b6de7e..171cb1146 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,15 @@ ## Table of Contents - [What is the RudderStack JavaScript SDK?](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#what-is-the-rudderstack-javascript-sdk) -- [How to use the RudderStack JavaScript SDK?](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#how-to-use-the-rudderstack-javascript-sdk) +- [How to use the RudderStack JavaScript SDK?](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#how-to-use-the-rudderstack-javascript-sdk) - [Querystring API](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#querystring-api) - [Adding Callbacks to Standard Methods](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#adding-callbacks-to-standard-methods) - [Self-Hosted Control Plane](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#self-hosted-control-plane) - [Contribute](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#contribute) | **IMPORTANT**: We have deprecated the Autotrack feature for the RudderStack JavaScript SDK. If you still wish to use it for your project, refer to [this repository](https://github.com/rudderlabs/rudder-sdk-js-autotrack#autotrack). | -|:------| +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + # What is RudderStack? @@ -16,7 +17,7 @@ # [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#what-is-the-rudderstack-javascript-sdk)What Is the RudderStack JavaScript SDK? -The RudderStack JavaScript SDK (released under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)) allows you to utilize our npm module `rudder-sdk-js` or `rudder-analytics.js` library to start sending event data from your website to RudderStack. After integrating this SDK, you will also be able to connect to multiple destinations such as Amplitude, Google Analytics, etc. to send your data. +The RudderStack JavaScript SDK (released under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)) allows you to utilize our npm module `rudder-sdk-js` or `rudder-analytics.js` library to start sending event data from your website to RudderStack. After integrating this SDK, you will also be able to connect to multiple destinations such as Amplitude, Google Analytics, etc. to send your data. # [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#how-to-use-the-rudderstack-javascript-sdk)How to Use the RudderStack JavaScript SDK? @@ -24,14 +25,14 @@ This Quick Start Guide will help you get up and running with using the RudderSta ## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-1-install-rudderstack-using-the-code-snippet)Step 1: Install RudderStack Using the Code Snippet -To integrate the SDK, place the following code snippet in the `` section of your website. +To integrate the SDK, place the following code snippet in the `` section of your website. You can use either the minified or non-minified version of the code: The minified version is as follows: ``` - @@ -44,7 +45,7 @@ The non-minified version of the code is shown below: ``` -> **NOTE**: Whichever version of the code you use, you need to replace `YOUR_WRITE_KEY` with the write key in the RudderStack Control Plane and `DATA_PLANE_URL` with the URL of the RudderStack Server/ Data Plane.

+> **NOTE**: Whichever version of the code you use, you need to replace `YOUR_WRITE_KEY` with the write key in the RudderStack Control Plane and `DATA_PLANE_URL` with the URL of the RudderStack Server/ Data Plane.

> **NOTE** : In all the above versions, there is an explicit `page` call at the end. This is added to ensure that whenever the SDK loads in a page, a `page` call is being sent. You can remove this call completely or modify with extra page properties to suit your requirement. You can also add `page` calls in your application in places not tied directly to page load, ex: virtual page views, page renders on route change such as in SPAs. | **IMPORTANT**: We are moving our SDK to a different path from [https://cdn.rudderlabs.com/rudder-analytics.min.js](https://cdn.rudderlabs.com/rudder-analytics.min.js) to [https://cdn.rudderlabs.com/v1/rudder-analytics.min.js](https://cdn.rudderlabs.com/v1/rudder-analytics.min.js). The earlier path may not be maintained in coming releases. | -|:------| +| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ### Alternative Installation using NPM While we recommended you use the JavaScript snippet above to use the SDK in your websites, you can also use this [NPM module](https://www.npmjs.com/package/rudder-sdk-js) to package RudderStack directly into your project. - - To install, run: -`npm install rudder-sdk-js --save` +- To install, run: + `npm install rudder-sdk-js --save` - Since the module exports a bunch of APIs on an already-defined object combined with node module caching, you should run the below code only once and use the exported object throughout your project : - ``` - import * as rudderanalytics from "rudder-sdk-js" +``` +import * as rudderanalytics from "rudder-sdk-js" rudderanalytics.ready(() => {console.log("we are all set!!!")}) rudderanalytics.load(YOUR_WRITE_KEY, DATA_PLANE_URL) export { rudderanalytics } - ``` - - For ES5, with *require*: +``` + +For ES5, with _require_: + ``` var rudderanalytics = require("rudder-sdk-js") rudderanalytics.load(YOUR_WRITE_KEY, DATA_PLANE_URL) exports.rudderanalytics = rudderanalytics -``` +``` You can also refer to the sample projects for a walkthrough of the above: [Sample Angular Project](https://github.com/rudderlabs/rudder-analytics-angular) and [Sample React Project](https://github.com/rudderlabs/rudder-analytics-react) **SDK-supported Browser Versions** - - Safari >=6 - - IE >=10 - - Edge >=15 - - Mozilla >=40 - - Chrome >= 37 - - Opera >= 23 - - Yandex>=14.12 - - > **NOTE**: If the SDK doesn't work on the versions you are targeting, check if adding browser polyfills to your application solves the issue. +- Safari >=6 +- IE >=10 +- Edge >=15 +- Mozilla >=40 +- Chrome >= 37 +- Opera >= 23 +- Yandex>=14.12 -## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-2-identify-your-users-using-the-identify-method)Step 2: Identify Your Users With the `identify()` Method: +> **NOTE**: If the SDK doesn't work on the versions you are targeting, check if adding browser polyfills to your application solves the issue. -The `identify()` method allows you to link users and their actions to a specific userid. +## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-2-identify-your-users-using-the-identify-method)Step 2: Identify Your Users With the `identify()` Method: -A sample example of how the `identify()` method works is as shown: +The `identify()` method allows you to link users and their actions to a specific userid. + +A sample example of how the `identify()` method works is as shown: ``` rudderanalytics.identify( @@ -161,11 +162,11 @@ rudderanalytics.identify( In the above example, information such as the user ID, email along with contextual information such as IP address, anonymousId, etc. will be captured. -> **NOTE**: There is no need to call `identify()` for anonymous visitors to your website. Such visitors are automatically assigned an `anonymousId`. +> **NOTE**: There is no need to call `identify()` for anonymous visitors to your website. Such visitors are automatically assigned an `anonymousId`. -## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-3-track-your-users-actions-using-the-track-method)Step 3: Track Your Users’ Actions With the `track()` Method +## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-3-track-your-users-actions-using-the-track-method)Step 3: Track Your Users’ Actions With the `track()` Method -The `track()` method allows you to track any actions that your users might perform. +The `track()` method allows you to track any actions that your users might perform. A sample example of how the `track()` method works is as shown: @@ -195,17 +196,17 @@ rudderanalytics.track( revenue: 30, currency: 'USD' , user_actual_id: 12345 - }, + }, () => {console.log("in track call");} ); ``` -You’ve now successfully installed `rudder-analytics.js` tracking. You can enable and use any event destination to send your event data via RudderStack, in no time at all. +You’ve now successfully installed `rudder-analytics.js` tracking. You can enable and use any event destination to send your event data via RudderStack, in no time at all. ## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-4-check-ready-state)Step 4: Check Ready State -There are cases when you may want to tap into the features provide by end destination SDKs to enhance tracking and other functionalities. RudderStack's JavaScript SDK exposes a `ready` API with a `callback` parameter, that fires when the SDK is done initializing itself and other third-party native SDK destinations. +There are cases when you may want to tap into the features provide by end destination SDKs to enhance tracking and other functionalities. RudderStack's JavaScript SDK exposes a `ready` API with a `callback` parameter, that fires when the SDK is done initializing itself and other third-party native SDK destinations. For example: @@ -216,8 +217,11 @@ rudderanalytics.ready( ``` +# [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#adding-callbacks-to-standard-methods)Adding callbacks to standard methods + | **For detailed technical documentation and troubleshooting guide on the RudderStack’s JavaScript SDK, check out our [docs](https://docs.rudderlabs.com/sdk-integration-guide/getting-started-with-javascript-sdk).** | -|:------| +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + # [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#querystring-api)Querystring API @@ -228,6 +232,7 @@ For example: ``` http://hostname.com/?ajs_uid=12345&ajs_event=test%20event&ajs_aid=abcde&ajs_prop_testProp=prop1&ajs_trait_name=Firstname+Lastname ``` + For the above URL, the below SDK calls will be triggered: ``` @@ -238,25 +243,21 @@ rudderanalytics.setAnonymousId("abcde"); You may use the below parameters as querystring parameter and trigger the corresponding call. -`ajs_uid` : Makes a `rudderanalytics.identify()` call with `userId` having the value of the parameter value. - -`ajs_aid` : Makes a `rudderanalytics.setAnonymousId()` call with `anonymousId` having the value of the parameter value. - -`ajs_event` : Makes a `rudderanalytics.track()` call with `event` name as parameter value. +`ajs_uid` : Makes a `rudderanalytics.identify()` call with `userId` having the value of the parameter value. -`ajs_prop_` : If `ajs_event` is passed as querystring, value of this parameter will populate the `properties` of the corresponding event in the `track` call. +`ajs_aid` : Makes a `rudderanalytics.setAnonymousId()` call with `anonymousId` having the value of the parameter value. -`ajs_trait_` : If `ajs_uid` is provided as querysting, value of this parameter will populate the `traits` of the `identify` call made. +`ajs_event` : Makes a `rudderanalytics.track()` call with `event` name as parameter value. -| **IMPORTANT**: This feature is not supported in NPM module yet. It will be released soon. | -|:------| +`ajs_prop_` : If `ajs_event` is passed as querystring, value of this parameter will populate the `properties` of the corresponding event in the `track` call. +`ajs_trait_` : If `ajs_uid` is provided as querysting, value of this parameter will populate the `traits` of the `identify` call made. # [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#adding-callbacks-to-standard-methods)Adding Callbacks to Standard Methods -You can also define callbacks to the common methods of the `rudderanalytics` object. +You can also define callbacks to the common methods of the `rudderanalytics` object. -> **Note**: For now, the functionality is supported for `syncPixel` method which is called in the SDK when making sync calls in integrations for relevant destinations. +> **Note**: For now, the functionality is supported for `syncPixel` method which is called in the SDK when making sync calls in integrations for relevant destinations. For example: @@ -267,14 +268,15 @@ rudderanalytics.syncPixelCallback = obj => { "sync lotame", { destination: obj.destination }, { integrations: { All: false, S3: true } } - ); + ); }; ``` -In the above example, we are defining a `syncPixelCallback` on the analytics object before the call to load the SDK. This will lead to calling of this registered callback with the parameter `{destination: }` whenever a sync call is made from the SDK for relevant integrations like _Lotame_. + +In the above example, we are defining a `syncPixelCallback` on the analytics object before the call to load the SDK. This will lead to calling of this registered callback with the parameter `{destination: }` whenever a sync call is made from the SDK for relevant integrations like _Lotame_. The callback can be supplied in options parameter like below as well: @@ -288,11 +290,10 @@ rudderanalytics.load(YOUR_WRITE_KEY, DATA_PLANE_URL, ) ``` - -We will be adding similar callbacks for APIs such as `track`, `page`, `identify`, etc. +We will be adding similar callbacks for APIs such as `track`, `page`, `identify`, etc. | **IMPORTANT**: We have deprecated the Autotrack feature for the RudderStack JavaScript SDK. If you still wish to use it for your project, refer to [this repository](https://github.com/rudderlabs/rudder-sdk-js-autotrack#autotrack). | -|:------| +| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | # [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#self-hosted-control-plane)Self-Hosted Control Plane @@ -310,15 +311,15 @@ You can start adding integrations of your choice for sending data through their ## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#how-to-build-the-sdk)How To Build the SDK -- Look for run scripts in the `package.json` file for getting browser minified and non-minified builds. The builds are updated in the `dist` folder of the directory. Among the others, the important ones are: - - - `npm run buildProdBrowser` : This outputs **rudder-analytics.min.js**. - - `npm run buildProdBrowserBrotli`: This outputs two files, **rudder-analytics.min.br.js** (the original minified file, same as above) and **rudder-analytics.min.br.js.br** (the brotli compressed file). - - `npm run buildProdBrowserGzip`: This outputs two files, **rudder-analytics.min.gzip.js** (the original minified file, same as above) and **rudder-analytics.min.gzip.js.gz** (the gzipped compressed file). - - We are using **rollup** to build our SDKs, configuration for it is present in `rollup.config.js` in the repo directory. - -- For adding or removing integrations, modify the imports in `index.js` under integrations folder. +- Look for run scripts in the `package.json` file for getting browser minified and non-minified builds. The builds are updated in the `dist` folder of the directory. Among the others, the important ones are: + + - `npm run buildProdBrowser` : This outputs **rudder-analytics.min.js**. + - `npm run buildProdBrowserBrotli`: This outputs two files, **rudder-analytics.min.br.js** (the original minified file, same as above) and **rudder-analytics.min.br.js.br** (the brotli compressed file). + - `npm run buildProdBrowserGzip`: This outputs two files, **rudder-analytics.min.gzip.js** (the original minified file, same as above) and **rudder-analytics.min.gzip.js.gz** (the gzipped compressed file). + + We are using **rollup** to build our SDKs, configuration for it is present in `rollup.config.js` in the repo directory. + +- For adding or removing integrations, modify the imports in `index.js` under integrations folder. # Contact Us diff --git a/__tests__/script.test.js b/__tests__/script.test.js index 0c3048b44..4e95bd9bc 100644 --- a/__tests__/script.test.js +++ b/__tests__/script.test.js @@ -6,7 +6,7 @@ test("Check SDK is loaded as object and api calls reaching to hit network", () = send: jest.fn(), readyState: 4, responseText: JSON.stringify({}), - status: 200, + status: 200 }; window.XMLHttpRequest = jest.fn(() => xhrMock); @@ -23,7 +23,7 @@ test("Check SDK is loaded as object and api calls reaching to hit network", () = "group", "identify", "ready", - "reset", + "reset" ], i = 0; i < methods.length; @@ -38,8 +38,7 @@ test("Check SDK is loaded as object and api calls reaching to hit network", () = } rudderanalytics.load( "1d4Qof5j9WqTuFhvUkmLaHe4EV3", - "https://hosted.rudderlabs.com", - { logLevel: "DEBUG" } + "https://hosted.rudderlabs.com" ), rudderanalytics.page(); diff --git a/analytics.js b/analytics.js index 370140ed7..d74883290 100644 --- a/analytics.js +++ b/analytics.js @@ -24,11 +24,12 @@ import { findAllEnabledDestinations, tranformToRudderNames, transformToServerNames, + checkReservedKeywords } from "./utils/utils"; import { CONFIG_URL, MAX_WAIT_FOR_INTEGRATION_LOAD, - INTEGRATION_LOAD_CHECK_INTERVAL, + INTEGRATION_LOAD_CHECK_INTERVAL } from "./utils/constants"; import { integrations } from "./integrations"; import RudderElementBuilder from "./utils/RudderElementBuilder"; @@ -41,7 +42,7 @@ import parseLinker from "./utils/linker"; const queryDefaults = { trait: "ajs_trait_", - prop: "ajs_prop_", + prop: "ajs_prop_" }; // https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js @@ -71,6 +72,7 @@ class Analytics { this.autoTrackHandlersRegistered = false; this.autoTrackFeatureEnabled = false; this.initialized = false; + this.areEventsReplayed = false; this.trackValues = []; this.eventsBuffer = []; this.clientIntegrations = []; @@ -88,9 +90,10 @@ class Analytics { this.readyCallback = () => {}; this.executeReadyCallback = undefined; this.methodToCallbackMapping = { - syncPixel: "syncPixelCallback", + syncPixel: "syncPixelCallback" }; this.loaded = false; + this.loadIntegration = true; } /** @@ -145,12 +148,12 @@ class Analytics { } response.source.destinations.forEach(function (destination, index) { logger.debug( - `Destination ${index} Enabled? ${destination.enabled} Type: ${destination.destinationDefinition.name} Use Native SDK? ${destination.config.useNativeSDK}` + `Destination ${index} Enabled? ${destination.enabled} Type: ${destination.destinationDefinition.name} Use Native SDK? true` ); if (destination.enabled) { this.clientIntegrations.push({ name: destination.destinationDefinition.name, - config: destination.config, + config: destination.config }); } }, this); @@ -163,7 +166,7 @@ class Analytics { ); // remove from the list which don't have support yet in SDK - this.clientIntegrations = this.clientIntegrations.filter((intg) => { + this.clientIntegrations = this.clientIntegrations.filter(intg => { return integrations[intg.name] != undefined; }); @@ -202,8 +205,8 @@ class Analytics { this.toBeProcessedByIntegrationArray = []; return; } - - intgArray.forEach((intg) => { + let intgInstance; + intgArray.forEach(intg => { try { logger.debug( "[Analytics] init :: trying to initialize integration name:: ", @@ -211,7 +214,7 @@ class Analytics { ); const intgClass = integrations[intg.name]; const destConfig = intg.config; - const intgInstance = new intgClass(destConfig, self); + intgInstance = new intgClass(destConfig, self); intgInstance.init(); logger.debug("initializing destination: ", intg); @@ -222,6 +225,7 @@ class Analytics { "[Analytics] initialize integration (integration.init()) failed :: ", intg.name ); + this.failedToBeLoadedIntegration.push(intgInstance); } }); } @@ -229,13 +233,16 @@ class Analytics { // eslint-disable-next-line class-methods-use-this replayEvents(object) { if ( - object.successfullyLoadedIntegration.length + + (object.successfullyLoadedIntegration.length + object.failedToBeLoadedIntegration.length === - object.clientIntegrations.length + object.clientIntegrations.length) && + !object.areEventsReplayed ) { logger.debug( "===replay events called====", + " successfully loaded count: ", object.successfullyLoadedIntegration.length, + " failed loaded count: ", object.failedToBeLoadedIntegration.length ); // eslint-disable-next-line no-param-reassign @@ -245,6 +252,7 @@ class Analytics { logger.debug( "==registering after callback===", + " after to be called after count : ", object.clientIntegrationObjects.length ); object.executeReadyCallback = after( @@ -255,7 +263,7 @@ class Analytics { logger.debug("==registering ready callback==="); object.on("ready", object.executeReadyCallback); - object.clientIntegrationObjects.forEach((intg) => { + object.clientIntegrationObjects.forEach(intg => { logger.debug("===looping over each successful integration===="); if (!intg.isReady || intg.isReady()) { logger.debug("===letting know I am ready=====", intg.name); @@ -265,7 +273,7 @@ class Analytics { if (object.toBeProcessedByIntegrationArray.length > 0) { // send the queued events to the fetched integration - object.toBeProcessedByIntegrationArray.forEach((event) => { + object.toBeProcessedByIntegrationArray.forEach(event => { const methodName = event[0]; event.shift(); @@ -315,17 +323,18 @@ class Analytics { }); object.toBeProcessedByIntegrationArray = []; } + object.areEventsReplayed = true; } } pause(time) { - return new Promise((resolve) => { + return new Promise(resolve => { setTimeout(resolve, time); }); } isInitialized(instance, time = 0) { - return new Promise((resolve) => { + return new Promise(resolve => { if (instance.isLoaded()) { logger.debug("===integration loaded successfully====", instance.name); this.successfullyLoadedIntegration.push(instance); @@ -530,7 +539,6 @@ class Analytics { } else { rudderElement.setProperty({}); } - this.trackEvent(rudderElement, options, callback); } @@ -583,7 +591,7 @@ class Analytics { rudderElement.message.context.traits ) { this.userTraits = { - ...rudderElement.message.context.traits, + ...rudderElement.message.context.traits }; this.storage.setUserTraits(this.userTraits); } @@ -646,7 +654,7 @@ class Analytics { // rudderElement.message.context.page = getDefaultPageProperties(); rudderElement.message.context.traits = { - ...this.userTraits, + ...this.userTraits }; logger.debug("anonymousId: ", this.anonymousId); @@ -661,7 +669,7 @@ class Analytics { } if (this.groupTraits) { rudderElement.message.traits = { - ...this.groupTraits, + ...this.groupTraits }; } } @@ -669,6 +677,9 @@ class Analytics { this.processOptionsParam(rudderElement, options); logger.debug(JSON.stringify(rudderElement)); + // check for reserved keys and log + checkReservedKeywords(rudderElement.message, type); + // structure user supplied integrations object to rudder format if (Object.keys(rudderElement.message.integrations).length > 0) { tranformToRudderNames(rudderElement.message.integrations); @@ -686,7 +697,7 @@ class Analytics { // try to first send to all integrations, if list populated from BE try { - succesfulLoadedIntersectClientSuppliedIntegrations.forEach((obj) => { + succesfulLoadedIntersectClientSuppliedIntegrations.forEach(obj => { if (!obj.isFailed || !obj.isFailed()) { if (obj[type]) { obj[type](rudderElement); @@ -759,18 +770,18 @@ class Analytics { const toplevelElements = [ "integrations", "anonymousId", - "originalTimestamp", + "originalTimestamp" ]; for (const key in options) { if (toplevelElements.includes(key)) { rudderElement.message[key] = options[key]; } else if (key !== "context") { rudderElement.message.context = merge(rudderElement.message.context, { - [key]: options[key], + [key]: options[key] }); } else if (typeof options[key] === "object" && options[key] != null) { rudderElement.message.context = merge(rudderElement.message.context, { - ...options[key], + ...options[key] }); } else { logger.error( @@ -834,14 +845,18 @@ class Analytics { * 2. rudderAmpLinkerParm: value generated from linker query parm (rudderstack) * using praseLinker util. * 3. generateUUID: A new uniquie id is generated and assigned. - * - * @param {string} anonymousId - * @param {string} rudderAmpLinkerParm + * + * @param {string} anonymousId + * @param {string} rudderAmpLinkerParm */ setAnonymousId(anonymousId, rudderAmpLinkerParm) { // if (!this.loaded) return; - const parsedAnonymousIdObj = rudderAmpLinkerParm ? parseLinker(rudderAmpLinkerParm) : null; - const parsedAnonymousId = parsedAnonymousIdObj ? parsedAnonymousIdObj.rs_amp_id : null; + const parsedAnonymousIdObj = rudderAmpLinkerParm + ? parseLinker(rudderAmpLinkerParm) + : null; + const parsedAnonymousId = parsedAnonymousIdObj + ? parsedAnonymousIdObj.rs_amp_id + : null; this.anonymousId = anonymousId || parsedAnonymousId || generateUUID(); this.storage.setAnonymousId(this.anonymousId); } @@ -881,7 +896,7 @@ class Analytics { if (!this.isValidWriteKey(writeKey) || !this.isValidServerUrl(serverUrl)) { handleError({ message: - "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl", + "[Analytics] load:: Unable to load due to wrong writeKey or serverUrl" }); throw Error("failed to initialize"); } @@ -906,7 +921,7 @@ class Analytics { if (options && options.clientSuppliedCallbacks) { // convert to rudder recognised method names const tranformedCallbackMapping = {}; - Object.keys(this.methodToCallbackMapping).forEach((methodName) => { + Object.keys(this.methodToCallbackMapping).forEach(methodName => { if (this.methodToCallbackMapping.hasOwnProperty(methodName)) { if ( options.clientSuppliedCallbacks[ @@ -935,6 +950,10 @@ class Analytics { this.eventRepository.startQueue({}); } + if (options && options.loadIntegration != undefined) { + this.loadIntegration = !!options.loadIntegration; + } + this.eventRepository.writeKey = writeKey; if (serverUrl) { this.eventRepository.url = serverUrl; @@ -967,6 +986,7 @@ class Analytics { addDomEventHandlers(this); } } + processDataInAnalyticsArray(this); } ready(callback) { @@ -979,7 +999,7 @@ class Analytics { } initializeCallbacks() { - Object.keys(this.methodToCallbackMapping).forEach((methodName) => { + Object.keys(this.methodToCallbackMapping).forEach(methodName => { if (this.methodToCallbackMapping.hasOwnProperty(methodName)) { this.on(methodName, () => {}); } @@ -988,7 +1008,7 @@ class Analytics { registerCallbacks(calledFromLoad) { if (!calledFromLoad) { - Object.keys(this.methodToCallbackMapping).forEach((methodName) => { + Object.keys(this.methodToCallbackMapping).forEach(methodName => { if (this.methodToCallbackMapping.hasOwnProperty(methodName)) { if (window.rudderanalytics) { if ( @@ -1017,7 +1037,7 @@ class Analytics { }); } - Object.keys(this.clientSuppliedCallbacks).forEach((methodName) => { + Object.keys(this.clientSuppliedCallbacks).forEach(methodName => { if (this.clientSuppliedCallbacks.hasOwnProperty(methodName)) { logger.debug( "registerCallbacks", @@ -1043,7 +1063,7 @@ class Analytics { parseQueryString(query) { function getTraitsFromQueryObject(qObj) { const traits = {}; - Object.keys(qObj).forEach((key) => { + Object.keys(qObj).forEach(key => { if (key.substr(0, queryDefaults.trait.length) == queryDefaults.trait) { traits[key.substr(queryDefaults.trait.length)] = qObj[key]; } @@ -1054,7 +1074,7 @@ class Analytics { function getEventPropertiesFromQueryObject(qObj) { const props = {}; - Object.keys(qObj).forEach((key) => { + Object.keys(qObj).forEach(key => { if (key.substr(0, queryDefaults.prop.length) == queryDefaults.prop) { props[key.substr(queryDefaults.prop.length)] = qObj[key]; } @@ -1083,22 +1103,36 @@ class Analytics { } } -function pushDataToAnalyticsArray(argumentsArray, obj) { +function pushQueryStringDataToAnalyticsArray(obj) { if (obj.anonymousId) { if (obj.userId) { - argumentsArray.unshift( + instance.toBeProcessedArray.push( ["setAnonymousId", obj.anonymousId], ["identify", obj.userId, obj.traits] ); } else { - argumentsArray.unshift(["setAnonymousId", obj.anonymousId]); + instance.toBeProcessedArray.push(["setAnonymousId", obj.anonymousId]); } } else if (obj.userId) { - argumentsArray.unshift(["identify", obj.userId, obj.traits]); + instance.toBeProcessedArray.push(["identify", obj.userId, obj.traits]); } if (obj.event) { - argumentsArray.push(["track", obj.event, obj.properties]); + instance.toBeProcessedArray.push(["track", obj.event, obj.properties]); + } +} + +function processDataInAnalyticsArray(analytics) { + if (instance.loaded) { + for (let i = 0; i < analytics.toBeProcessedArray.length; i++) { + const event = [...analytics.toBeProcessedArray[i]]; + const method = event[0]; + event.shift(); + logger.debug("=====from analytics array, calling method:: ", method); + analytics[method](...event); + } + + instance.toBeProcessedArray = []; } } @@ -1108,7 +1142,7 @@ Emitter(instance); window.addEventListener( "error", - (e) => { + e => { handleError(e, instance); }, true @@ -1147,21 +1181,15 @@ if ( // once loaded, parse querystring of the page url to send events const parsedQueryObject = instance.parseQueryString(window.location.search); -pushDataToAnalyticsArray(argumentsArray, parsedQueryObject); +pushQueryStringDataToAnalyticsArray(parsedQueryObject); -if (eventsPushedAlready && argumentsArray && argumentsArray.length > 0) { +if (argumentsArray && argumentsArray.length > 0) { for (let i = 0; i < argumentsArray.length; i++) { instance.toBeProcessedArray.push(argumentsArray[i]); } - - for (let i = 0; i < instance.toBeProcessedArray.length; i++) { - const event = [...instance.toBeProcessedArray[i]]; - const method = event[0]; - event.shift(); - logger.debug("=====from init, calling method:: ", method); - instance[method](...event); - } - instance.toBeProcessedArray = []; +} +if (eventsPushedAlready) { + processDataInAnalyticsArray(instance); } // } @@ -1188,5 +1216,5 @@ export { alias, group, getAnonymousId, - setAnonymousId, + setAnonymousId }; diff --git a/dist/rudder-analytics.min.js b/dist/rudder-analytics.min.js deleted file mode 100644 index 821a6e1b4..000000000 --- a/dist/rudder-analytics.min.js +++ /dev/null @@ -1,2 +0,0 @@ -var rudderanalytics=function(e){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n-1},se.prototype.set=function(e,t){var n=this.__data__,r=pe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new oe,map:new(ne||se),string:new oe}},ae.prototype.delete=function(e){var t=ke(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return ke(this,e).get(e)},ae.prototype.has=function(e){return ke(this,e).has(e)},ae.prototype.set=function(e,t){var n=ke(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ce.prototype.clear=function(){this.__data__=new se,this.size=0},ce.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ce.prototype.get=function(e){return this.__data__.get(e)},ce.prototype.has=function(e){return this.__data__.has(e)},ce.prototype.set=function(e,t){var n=this.__data__;if(n instanceof se){var i=n.__data__;if(!ne||i.length-1&&e%1==0&&e0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(Z?function(e,t){return Z(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Fe);function Te(e,t){return e===t||e!=e&&t!=t}var Oe=ye(function(){return arguments}())?ye:function(e){return Me(e)&&N.call(e,"callee")&&!$.call(e,"callee")},Se=Array.isArray;function xe(e){return null!=e&&Le(e.length)&&!je(e)}var Re=X||function(){return!1};function je(e){if(!Ue(e))return!1;var t=me(e);return t==l||t==p||t==d||t==g}function Le(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function Ue(e){var n=t(e);return null!=e&&("object"==n||"function"==n)}function Me(e){return null!=e&&"object"==t(e)}var De=T?function(e){return function(t){return e(t)}}(T):function(e){return Me(e)&&Le(e.length)&&!!b[me(e)]};function Ne(e){return xe(e)?ue(e,!0):be(e)}var Be,qe=(Be=function(e,t,n){we(e,t,n)},_e((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,s=i>2?n[2]:void 0;for(o=Be.length>3&&"function"==typeof o?(i--,o):void 0,s&&function(e,n,r){if(!Ue(r))return!1;var i=t(n);return!!("number"==i?xe(r)&&Ee(n,r.length):"string"==i&&n in r)&&Te(r[n],e)}(n[0],n[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++r-1?t:t+e:window.location.href,r=n.indexOf("#");return r>-1?n.slice(0,r):n}(r)}}function X(){for(var e,t=document.getElementsByTagName("link"),n=0;e=t[n];n++)if("canonical"===e.getAttribute("rel"))return e.getAttribute("href")}function ee(e,t){var n=e.revenue;return!n&&t&&t.match(/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i)&&(n=e.total),function(e){if(e){if("number"==typeof e)return e;if("string"==typeof e)return e=e.replace(/\$/g,""),e=parseFloat(e),isNaN(e)?void 0:e}}(n)}function te(e){Object.keys(e).forEach((function(t){e.hasOwnProperty(t)&&(G[t]&&(e[G[t]]=e[t]),"All"!=t&&null!=G[t]&&G[t]!=t&&delete e[t])}))}function ne(e,n){var r=[];if(!n||0==n.length)return r;var i=!0;return"string"==typeof n[0]?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t]&&0==e[t]&&(n=!1),n&&r.push(t)}else null!=e[t]&&1==e[t]&&r.push(t)})),r):"object"===t(n[0])?(null!=e.All&&(i=e.All),n.forEach((function(t){if(i){var n=!0;null!=e[t.name]&&0==e[t.name]&&(n=!1),n&&r.push(t)}else null!=e[t.name]&&1==e[t.name]&&r.push(t)})),r):void 0}function re(e,t){return t=t||se,"array"==ae(e)?ie(e,t):oe(e,t)}var ie=function(e,t){for(var n=[],r=0;r=0},we.bool=we.boolean=function(e){return"[object Boolean]"===ge.call(e)},we.false=function(e){return we.bool(e)&&!1===Boolean(Number(e))},we.true=function(e){return we.bool(e)&&!0===Boolean(Number(e))},we.date=function(e){return"[object Date]"===ge.call(e)},we.date.valid=function(e){return we.date(e)&&!isNaN(Number(e))},we.element=function(e){return void 0!==e&&"undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&1===e.nodeType},we.error=function(e){return"[object Error]"===ge.call(e)},we.fn=we.function=function(e){if("undefined"!=typeof window&&e===window.alert)return!0;var t=ge.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t},we.number=function(e){return"[object Number]"===ge.call(e)},we.infinite=function(e){return e===1/0||e===-1/0},we.decimal=function(e){return we.number(e)&&!me(e)&&!we.infinite(e)&&e%1!=0},we.divisibleBy=function(e,t){var n=we.infinite(e),r=we.infinite(t),i=we.number(e)&&!me(e)&&we.number(t)&&!me(t)&&0!==t;return n||r||i&&e%t==0},we.integer=we.int=function(e){return we.number(e)&&!me(e)&&e%1==0},we.maximum=function(e,t){if(me(e))throw new TypeError("NaN is not a valid value");if(!we.arraylike(t))throw new TypeError("second argument must be array-like");for(var n=t.length;--n>=0;)if(e=0;)if(e>t[n])return!1;return!0},we.nan=function(e){return!we.number(e)||e!=e},we.even=function(e){return we.infinite(e)||we.number(e)&&e==e&&e%2==0},we.odd=function(e){return we.infinite(e)||we.number(e)&&e==e&&e%2!=0},we.ge=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!we.infinite(e)&&!we.infinite(t)&&e>=t},we.gt=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!we.infinite(e)&&!we.infinite(t)&&e>t},we.le=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!we.infinite(e)&&!we.infinite(t)&&e<=t},we.lt=function(e,t){if(me(e)||me(t))throw new TypeError("NaN is not a valid value");return!we.infinite(e)&&!we.infinite(t)&&e=t&&e<=n},we.object=function(e){return"[object Object]"===ge.call(e)},we.primitive=function(e){return!e||!("object"===t(e)||we.object(e)||we.fn(e)||we.array(e))},we.hash=function(e){return we.object(e)&&e.constructor===Object&&!e.nodeType&&!e.setInterval},we.regexp=function(e){return"[object RegExp]"===ge.call(e)},we.string=function(e){return"[object String]"===ge.call(e)},we.base64=function(e){return we.string(e)&&(!e.length||ve.test(e))},we.hex=function(e){return we.string(e)&&(!e.length||be.test(e))},we.symbol=function(e){return"function"==typeof Symbol&&"[object Symbol]"===ge.call(e)&&"symbol"===t(ue.call(e))},we.bigint=function(e){return"function"==typeof BigInt&&"[object BigInt]"===ge.call(e)&&"bigint"==typeof de.call(e)};var _e,ke=we,Ie=Object.prototype.toString,Ee=function(e){switch(Ie.call(e)){case"[object Function]":return"function";case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object String]":return"string"}return null===e?"null":void 0===e?"undefined":e&&1===e.nodeType?"element":e===Object(e)?"object":t(e)},Ae=/\b(Array|Date|Object|Math|JSON)\b/g,Ce=function(e,t){var n=function(e){for(var t=[],n=0;n-1?n:t.map((function(e){return e.product_id})).indexOf(e.properties.product_id)+1}},{key:"extractCheckoutOptions",value:function(e){var t=re([e.message.properties.paymentMethod,e.message.properties.shippingMethod]);return t.length>0?t.join(", "):null}}]),e}(),Me=function(){function e(t){n(this,e),this.siteId=t.siteID,this.name="HOTJAR",this._ready=!1}return i(e,[{key:"init",value:function(){window.hotjarSiteId=this.siteId,function(e,t,n,r,i,o){e.hj=e.hj||function(){(e.hj.q=e.hj.q||[]).push(arguments)},e._hjSettings={hjid:e.hotjarSiteId,hjsv:6},i=t.getElementsByTagName("head")[0],(o=t.createElement("script")).async=1,o.src="https://static.hotjar.com/c/hotjar-"+e._hjSettings.hjid+".js?sv="+e._hjSettings.hjsv,i.appendChild(o)}(window,document),this._ready=!0,z.debug("===in init Hotjar===")}},{key:"identify",value:function(e){if(e.message.userId||e.message.anonymousId){var t=e.message.context.traits;window.hj("identify",e.message.userId,t)}else z.debug("[Hotjar] identify:: user id is required")}},{key:"track",value:function(e){z.debug("[Hotjar] track:: method not supported")}},{key:"page",value:function(e){z.debug("[Hotjar] page:: method not supported")}},{key:"isLoaded",value:function(){return this._ready}},{key:"isReady",value:function(){return this._ready}}]),e}(),De=function(){function e(t){n(this,e),this.conversionId=t.conversionID,this.pageLoadConversions=t.pageLoadConversions,this.clickEventConversions=t.clickEventConversions,this.defaultPageConversion=t.defaultPageConversion,this.name="GOOGLEADS"}return i(e,[{key:"init",value:function(){!function(e,t,n){z.debug("in script loader=== ".concat(e));var r=n.createElement("script");r.src=t,r.async=1,r.type="text/javascript",r.id=e;var i=n.getElementsByTagName("head")[0];z.debug("==script==",i),i.appendChild(r)}("googleAds-integration","https://www.googletagmanager.com/gtag/js?id=".concat(this.conversionId),document),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),window.gtag("config",this.conversionId),z.debug("===in init Google Ads===")}},{key:"identify",value:function(e){z.debug("[GoogleAds] identify:: method not supported")}},{key:"track",value:function(e){z.debug("in GoogleAdsAnalyticsManager track");var t=this.getConversionData(this.clickEventConversions,e.message.event);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName,i="".concat(this.conversionId,"/").concat(n),o={};e.properties&&(o.value=e.properties.revenue,o.currency=e.properties.currency,o.transaction_id=e.properties.order_id),o.send_to=i,window.gtag("event",r,o)}}},{key:"page",value:function(e){z.debug("in GoogleAdsAnalyticsManager page");var t=this.getConversionData(this.pageLoadConversions,e.message.name);if(t.conversionLabel){var n=t.conversionLabel,r=t.eventName;window.gtag("event",r,{send_to:"".concat(this.conversionId,"/").concat(n)})}}},{key:"getConversionData",value:function(e,t){var n={};return e&&(t?e.forEach((function(e){e.name.toLowerCase()===t.toLowerCase()&&(n.conversionLabel=e.conversionLabel,n.eventName=e.name)})):this.defaultPageConversion&&(n.conversionLabel=this.defaultPageConversion,n.eventName="Viewed a Page")),n}},{key:"isLoaded",value:function(){return window.dataLayer.push!==Array.prototype.push}},{key:"isReady",value:function(){return window.dataLayer.push!==Array.prototype.push}}]),e}(),Ne=function(){function e(t,r){n(this,e),this.accountId=t.accountId,this.settingsTolerance=t.settingsTolerance,this.isSPA=t.isSPA,this.libraryTolerance=t.libraryTolerance,this.useExistingJquery=t.useExistingJquery,this.sendExperimentTrack=t.sendExperimentTrack,this.sendExperimentIdentify=t.sendExperimentIdentify,this.name="VWO",this.analytics=r,z.debug("Config ",t)}return i(e,[{key:"init",value:function(){z.debug("===in init VWO===");var e=this.accountId,t=this.settingsTolerance,n=this.libraryTolerance,r=this.useExistingJquery,i=this.isSPA;window._vwo_code=function(){var o=!1,s=document;return{use_existing_jquery:function(){return r},library_tolerance:function(){return n},finish:function(){if(!o){o=!0;var e=s.getElementById("_vis_opt_path_hides");e&&e.parentNode.removeChild(e)}},finished:function(){return o},load:function(e){var t=s.createElement("script");t.src=e,t.type="text/javascript",t.innerText,t.onerror=function(){_vwo_code.finish()},s.getElementsByTagName("head")[0].appendChild(t)},init:function(){var n=setTimeout("_vwo_code.finish()",t),r=s.createElement("style"),o="body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}",a=s.getElementsByTagName("head")[0];return r.setAttribute("id","_vis_opt_path_hides"),r.setAttribute("type","text/css"),r.styleSheet?r.styleSheet.cssText=o:r.appendChild(s.createTextNode(o)),a.appendChild(r),this.load("//dev.visualwebsiteoptimizer.com/j.php?a=".concat(e,"&u=").concat(encodeURIComponent(s.URL),"&r=").concat(Math.random(),"&f=").concat(+i)),n}}}(),window._vwo_settings_timer=window._vwo_code.init(),(this.sendExperimentTrack||this.experimentViewedIdentify)&&this.experimentViewed()}},{key:"experimentViewed",value:function(){var e=this;window.VWO=window.VWO||[];var t=this;window.VWO.push(["onVariationApplied",function(n){if(n){z.debug("Variation Applied");var r=n[1],i=n[2];if(z.debug("experiment id:",r,"Variation Name:",_vwo_exp[r].comb_n[i]),void 0!==_vwo_exp[r].comb_n[i]&&["VISUAL_AB","VISUAL","SPLIT_URL","SURVEY"].indexOf(_vwo_exp[r].type)>-1){try{t.sendExperimentTrack&&(z.debug("Tracking..."),e.analytics.track("Experiment Viewed",{experimentId:r,variationName:_vwo_exp[r].comb_n[i]}))}catch(e){z.error("[VWO] experimentViewed:: ",e)}try{t.sendExperimentIdentify&&(z.debug("Identifying..."),e.analytics.identify(o({},"Experiment: ".concat(r),_vwo_exp[r].comb_n[i])))}catch(e){z.error("[VWO] experimentViewed:: ",e)}}}}])}},{key:"identify",value:function(e){z.debug("method not supported")}},{key:"track",value:function(e){if("Order Completed"===e.message.event){var t=e.message.properties?e.message.properties.total||e.message.properties.revenue:0;z.debug("Revenue",t),window.VWO=window.VWO||[],window.VWO.push(["track.revenueConversion",t])}}},{key:"page",value:function(e){z.debug("method not supported")}},{key:"isLoaded",value:function(){return!!window._vwo_code}},{key:"isReady",value:function(){return!!window._vwo_code}}]),e}(),Be=function(){function e(t){n(this,e),this.containerID=t.containerID,this.name="GOOGLETAGMANAGER"}return i(e,[{key:"init",value:function(){z.debug("===in init GoogleTagManager==="),function(e,t,n,r,i){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var o=t.getElementsByTagName(n)[0],s=t.createElement(n);s.async=!0,s.src="https://www.googletagmanager.com/gtm.js?id=".concat(i).concat(""),o.parentNode.insertBefore(s,o)}(window,document,"script","dataLayer",this.containerID)}},{key:"identify",value:function(e){z.debug("[GTM] identify:: method not supported")}},{key:"track",value:function(e){z.debug("===in track GoogleTagManager===");var t=e.message,n=a({event:t.event,userId:t.userId,anonymousId:t.anonymousId},t.properties);this.sendToGTMDatalayer(n)}},{key:"page",value:function(e){z.debug("===in page GoogleTagManager===");var t,n=e.message,r=n.name,i=n.properties?n.properties.category:void 0;r&&(t="Viewed ".concat(r," page")),i&&r&&(t="Viewed ".concat(i," ").concat(r," page")),t||(t="Viewed a Page");var o=a({event:t,userId:n.userId,anonymousId:n.anonymousId},n.properties);this.sendToGTMDatalayer(o)}},{key:"isLoaded",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}},{key:"sendToGTMDatalayer",value:function(e){window.dataLayer.push(e)}},{key:"isReady",value:function(){return!(!window.dataLayer||Array.prototype.push===window.dataLayer.push)}}]),e}(),qe=function(){function e(t,r){if(n(this,e),this.analytics=r,this.appKey=t.appKey,t.appKey||(this.appKey=""),this.endPoint="",t.dataCenter){var i=t.dataCenter.trim().split("-");"eu"===i[0].toLowerCase()?this.endPoint="sdk.fra-01.braze.eu":this.endPoint="sdk.iad-".concat(i[1],".braze.com")}this.name="BRAZE",z.debug("Config ",t)}return i(e,[{key:"formatGender",value:function(e){if(e&&"string"==typeof e){return["woman","female","w","f"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.FEMALE:["man","male","m"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.MALE:["other","o"].indexOf(e.toLowerCase())>-1?window.appboy.ab.User.Genders.OTHER:void 0}}},{key:"init",value:function(){z.debug("===in init Braze==="),function(e,t,n,r,i){e.appboy={},e.appboyQueue=[];for(var o="initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib".split(" "),s=0;s>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,i=0;r>>6-2*i);return n}};e.exports=n}()})),ze={utf8:{stringToBytes:function(e){return ze.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(ze.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n>>24)|4278255360&(a[h]<<24|a[h]>>>8);a[c>>>5]|=128<>>9<<4)]=c;var f=e._ff,g=e._gg,m=e._hh,y=e._ii;for(h=0;h>>0,d=d+b>>>0,l=l+w>>>0,p=p+_>>>0}return t.endian([u,d,l,p])};o._ff=function(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+(i>>>0)+s;return(a<>>32-o)+t},o._gg=function(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+(i>>>0)+s;return(a<>>32-o)+t},o._hh=function(e,t,n,r,i,o,s){var a=e+(t^n^r)+(i>>>0)+s;return(a<>>32-o)+t},o._ii=function(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+(i>>>0)+s;return(a<>>32-o)+t},o._blocksize=16,o._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(o(e,n));return n&&n.asBytes?r:n&&n.asString?i.bytesToString(r):t.bytesToHex(r)}}()})),We=function(){function e(t){n(this,e),this.NAME="INTERCOM",this.API_KEY=t.apiKey,this.APP_ID=t.appId,this.MOBILE_APP_ID=t.mobileAppId,z.debug("Config ",t)}return i(e,[{key:"init",value:function(){window.intercomSettings={app_id:this.APP_ID},function(){var e=window,t=e.Intercom;if("function"==typeof t)t("reattach_activator"),t("update",e.intercomSettings);else{var n=document,r=function e(){e.c(arguments)};r.q=[],r.c=function(e){r.q.push(e)},e.Intercom=r;var i=function(){var e=n.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://widget.intercom.io/widget/".concat(window.intercomSettings.app_id);var t=n.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};"complete"===document.readyState?(i(),window.intercom_code=!0):e.attachEvent?(e.attachEvent("onload",i),window.intercom_code=!0):(e.addEventListener("load",i,!1),window.intercom_code=!0)}}()}},{key:"page",value:function(){window.Intercom("update")}},{key:"identify",value:function(e){var n={},r=e.message.context;if(null!=(r.Intercom?r.Intercom:null)){var i=r.Intercom.user_hash?r.Intercom.user_hash:null;null!=i&&(n.user_hash=i);var o=r.Intercom.hideDefaultLauncher?r.Intercom.hideDefaultLauncher:null;null!=o&&(n.hide_default_launcher=o)}Object.keys(r.traits).forEach((function(e){if(r.traits.hasOwnProperty(e)){var i=r.traits[e];if("company"===e){var o=[],s={};"string"==typeof r.traits[e]&&(s.company_id=He(r.traits[e]));var a="object"===t(r.traits[e])&&Object.keys(r.traits[e])||[];a.forEach((function(t){a.hasOwnProperty(t)&&("id"!=t?s[t]=r.traits[e][t]:s.company_id=r.traits[e][t])})),"object"!==t(r.traits[e])||a.includes("id")||(s.company_id=He(s.name)),o.push(s),n.companies=o}else n[e]=r.traits[e];switch(e){case"createdAt":n.created_at=i;break;case"anonymousId":n.user_id=i}}})),n.user_id=e.message.userId,window.Intercom("update",n)}},{key:"track",value:function(e){var t={},n=e.message;(n.properties?Object.keys(n.properties):null).forEach((function(e){var r=n.properties[e];t[e]=r})),n.event&&(t.event_name=n.event),t.user_id=n.userId?n.userId:n.anonymousId,t.created_at=Math.floor(new Date(n.originalTimestamp).getTime()/1e3),window.Intercom("trackEvent",t.event_name,t)}},{key:"isLoaded",value:function(){return!!window.intercom_code}},{key:"isReady",value:function(){return!!window.intercom_code}}]),e}(),Je=function(){function e(t){n(this,e),this.projectID=t.projectID,this.writeKey=t.writeKey,this.ipAddon=t.ipAddon,this.uaAddon=t.uaAddon,this.urlAddon=t.urlAddon,this.referrerAddon=t.referrerAddon,this.client=null,this.name="KEEN"}return i(e,[{key:"init",value:function(){z.debug("===in init Keen==="),le("keen-integration","https://cdn.jsdelivr.net/npm/keen-tracking@4");var e=setInterval(function(){void 0!==window.KeenTracking&&void 0!==window.KeenTracking&&(this.client=function(e){return e.client=new window.KeenTracking({projectId:e.projectID,writeKey:e.writeKey}),e.client}(this),clearInterval(e))}.bind(this),1e3)}},{key:"identify",value:function(e){z.debug("in Keen identify");var t=e.message.context.traits,n=e.message.userId?e.message.userId:e.message.anonymousId,r=e.message.properties?Object.assign(r,e.message.properties):{};r.user={userId:n,traits:t},r=this.getAddOn(r),this.client.extendEvents(r)}},{key:"track",value:function(e){z.debug("in Keen track");var t=e.message.event,n=e.message.properties;n=this.getAddOn(n),this.client.recordEvent(t,n)}},{key:"page",value:function(e){z.debug("in Keen page");var t=e.message.name,n=e.message.properties?e.message.properties.category:void 0,r="Loaded a Page";t&&(r="Viewed ".concat(t," page")),n&&t&&(r="Viewed ".concat(n," ").concat(t," page"));var i=e.message.properties;i=this.getAddOn(i),this.client.recordEvent(r,i)}},{key:"isLoaded",value:function(){return z.debug("in Keen isLoaded"),!(null==this.client)}},{key:"isReady",value:function(){return!(null==this.client)}},{key:"getAddOn",value:function(e){var t=[];return this.ipAddon&&(e.ip_address="${keen.ip}",t.push({name:"keen:ip_to_geo",input:{ip:"ip_address"},output:"ip_geo_info"})),this.uaAddon&&(e.user_agent="${keen.user_agent}",t.push({name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"parsed_user_agent"})),this.urlAddon&&(e.page_url=document.location.href,t.push({name:"keen:url_parser",input:{url:"page_url"},output:"parsed_page_url"})),this.referrerAddon&&(e.page_url=document.location.href,e.referrer_url=document.referrer,t.push({name:"keen:referrer_parser",input:{referrer_url:"referrer_url",page_url:"page_url"},output:"referrer_info"})),e.keen={addons:t},e}}]),e}(),$e=Object.prototype.hasOwnProperty,Ye=function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n-1&&s.push([a,n[a]])}},{key:"initAfterPage",value:function(){var e,t=this;e=function(){var e,n,r=t.isVideo?"chartbeat_video.js":"chartbeat.js";e=document.createElement("script"),n=document.getElementsByTagName("script")[0],e.type="text/javascript",e.async=!0,e.src="//static.chartbeat.com/js/".concat(r),n.parentNode.insertBefore(e,n)},et?rt(e):tt.push(e),this._isReady(this).then((function(e){z.debug("===replaying on chartbeat==="),e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,z.debug("===chartbeat loaded successfully==="),e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,z.debug("===chartbeat failed==="),r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}}]),e}(),ot=function(){function e(t,r){n(this,e),this.c2ID=t.c2ID,this.analytics=r,this.comScoreBeaconParam=t.comScoreBeaconParam?t.comScoreBeaconParam:{},this.isFirstPageCallMade=!1,this.failed=!1,this.comScoreParams={},this.replayEvents=[],this.name="COMSCORE"}return i(e,[{key:"init",value:function(){z.debug("===in init Comscore init===")}},{key:"identify",value:function(e){z.debug("in Comscore identify")}},{key:"track",value:function(e){z.debug("in Comscore track")}},{key:"page",value:function(e){if(z.debug("in Comscore page"),this.loadConfig(e),this.isFirstPageCallMade){if(this.failed)return void(this.replayEvents=[]);if(!this.isLoaded()&&!this.failed)return void this.replayEvents.push(["page",e]);e.message.properties;window.COMSCORE.beacon(this.comScoreParams)}else this.isFirstPageCallMade=!0,this.initAfterPage()}},{key:"loadConfig",value:function(e){z.debug("=====in loadConfig====="),this.comScoreParams=this.mapComscoreParams(e.message.properties),window._comscore=window._comscore||[],window._comscore.push(this.comScoreParams)}},{key:"initAfterPage",value:function(){z.debug("=====in initAfterPage====="),function(){var e=document.createElement("script"),t=document.getElementsByTagName("script")[0];e.async=!0,e.src="".concat("https:"==document.location.protocol?"https://sb":"http://b",".scorecardresearch.com/beacon.js"),t.parentNode.insertBefore(e,t)}(),this._isReady(this).then((function(e){e.replayEvents.forEach((function(t){e[t[0]](t[1])}))}))}},{key:"pause",value:function(e){return new Promise((function(t){setTimeout(t,e)}))}},{key:"_isReady",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return t.isLoaded()?(t.failed=!1,e.analytics.emit("ready"),r(e)):n>=1e4?(t.failed=!0,r(e)):void t.pause(1e3).then((function(){return t._isReady(e,n+1e3).then(r)}))}))}},{key:"mapComscoreParams",value:function(e){z.debug("=====in mapComscoreParams=====");var t=this.comScoreBeaconParam,n={};return Object.keys(t).forEach((function(r){if(r in e){var i=t[r],o=e[r];n[i]=o}})),n.c1="2",n.c2=this.c2ID,z.debug("=====in mapComscoreParams=====",n),n}},{key:"isLoaded",value:function(){return z.debug("in Comscore isLoaded"),!this.isFirstPageCallMade||!!window.COMSCORE}},{key:"isReady",value:function(){return!!window.COMSCORE}}]),e}(),st=function(){function e(t){n(this,e),this.blacklistPiiProperties=t.blacklistPiiProperties,this.categoryToContent=t.categoryToContent,this.pixelId=t.pixelId,this.eventsToEvents=t.eventsToEvents,this.eventCustomProperties=t.eventCustomProperties,this.valueFieldIdentifier=t.valueFieldIdentifier,this.advancedMapping=t.advancedMapping,this.traitKeyToExternalId=t.traitKeyToExternalId,this.legacyConversionPixelId=t.legacyConversionPixelId,this.userIdAsPixelId=t.userIdAsPixelId,this.whitelistPiiProperties=t.whitelistPiiProperties,this.name="FB_PIXEL"}return i(e,[{key:"init",value:function(){void 0===this.categoryToContent&&(this.categoryToContent=[]),void 0===this.legacyConversionPixelId&&(this.legacyConversionPixelId=[]),void 0===this.userIdAsPixelId&&(this.userIdAsPixelId=[]),z.debug("===in init FbPixel==="),window._fbq=function(){window.fbq.callMethod?window.fbq.callMethod.apply(window.fbq,arguments):window.fbq.queue.push(arguments)},window.fbq=window.fbq||window._fbq,window.fbq.push=window.fbq,window.fbq.loaded=!0,window.fbq.disablePushState=!0,window.fbq.allowDuplicatePageViews=!0,window.fbq.version="2.0",window.fbq.queue=[],window.fbq("init",this.pixelId),le("fbpixel-integration","https://connect.facebook.net/en_US/fbevents.js")}},{key:"isLoaded",value:function(){return z.debug("in FBPixel isLoaded"),!(!window.fbq||!window.fbq.callMethod)}},{key:"isReady",value:function(){return z.debug("in FBPixel isReady"),!(!window.fbq||!window.fbq.callMethod)}},{key:"page",value:function(e){window.fbq("track","PageView")}},{key:"identify",value:function(e){this.advancedMapping&&window.fbq("init",this.pixelId,e.message.context.traits)}},{key:"track",value:function(e){var t=this,n=this,r=e.message.event,i=this.formatRevenue(e.message.properties.revenue),o=this.buildPayLoad(e,!0);void 0===this.categoryToContent&&(this.categoryToContent=[]),void 0===this.legacyConversionPixelId&&(this.legacyConversionPixelId=[]),void 0===this.userIdAsPixelId&&(this.userIdAsPixelId=[]),o.value=i;var s,a,c=this.eventsToEvents,u=this.legacyConversionPixelId;if(s=c.reduce((function(e,t){return t.from===r&&e.push(t.to),e}),[]),a=u.reduce((function(e,t){return t.from===r&&e.push(t.to),e}),[]),x((function(t){o.currency=e.message.properties.currency||"USD",window.fbq("trackSingle",n.pixelId,t,o,{eventID:e.message.messageId})}),s),x((function(t){window.fbq("trackSingle",n.pixelId,t,{currency:e.message.properties.currency,value:i},{eventID:e.message.messageId})}),a),"Product List Viewed"===r){var d=[],l=e.message.properties.products,p=this.buildPayLoad(e,!0);Array.isArray(l)&&l.forEach((function(t){var n=t.product_id;n&&(g.push(n),d.push({id:n,quantity:e.message.properties.quantity}))})),g.length?f=["product"]:(g.push(e.message.properties.category||""),d.push({id:e.message.properties.category||"",quantity:1}),f=["product_group"]),window.fbq("trackSingle",n.pixelId,"ViewContent",this.merge({content_ids:g,content_type:this.getContentType(e,f),contents:d},p),{eventID:e.message.messageId}),x((function(r){window.fbq("trackSingle",n.pixelId,r,{currency:e.message.properties.currency,value:t.formatRevenue(e.message.properties.revenue)},{eventID:e.message.messageId})}),a)}else if("Product Viewed"===r){var h="properties.value"===this.valueFieldIdentifier;p=this.buildPayLoad(e,!0);window.fbq("trackSingle",n.pixelId,"ViewContent",this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:h?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p),{eventID:e.message.messageId}),x((function(r){window.fbq("trackSingle",n.pixelId,r,{currency:e.message.properties.currency,value:h?t.formatRevenue(e.message.properties.value):t.formatRevenue(e.message.properties.price)},{eventID:e.message.messageId})}),a)}else if("Product Added"===r){h="properties.value"===this.valueFieldIdentifier,p=this.buildPayLoad(e,!0);window.fbq("trackSingle",n.pixelId,"AddToCart",this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:h?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p),{eventID:e.message.messageId}),x((function(r){window.fbq("trackSingle",n.pixelId,r,{currency:e.message.properties.currency,value:h?t.formatRevenue(e.message.properties.value):t.formatRevenue(e.message.properties.price)},{eventID:e.message.messageId})}),a),this.merge({content_ids:[e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||""],content_type:this.getContentType(e,["product"]),content_name:e.message.properties.product_name||"",content_category:e.message.properties.category||"",currency:e.message.properties.currency,value:h?this.formatRevenue(e.message.properties.value):this.formatRevenue(e.message.properties.price),contents:[{id:e.message.properties.product_id||e.message.properties.id||e.message.properties.sku||"",quantity:e.message.properties.quantity,item_price:e.message.properties.price}]},p)}else if("Order Completed"===r){l=e.message.properties.products,p=this.buildPayLoad(e,!0),i=this.formatRevenue(e.message.properties.revenue);for(var f=this.getContentType(e,["product"]),g=[],m=(d=[],0);m=0&&ke.date(h))d[p]=h.toISOTring().split("T")[0];else if(a.hasOwnProperty(p))a[p]&&"string"==typeof h&&(d[p]=sha256(h));else{var f=r.indexOf(p)>=0,g=i.indexOf(p)>=0;f&&!g||(d[p]=h)}}return d}}]),e}(),at=d((function(e,t){var n;e.exports=(n=n||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){t=t;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},u=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},d=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,u=e.min(4*c,i);if(c){for(var d=0;d>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>6-s%4*2;i[o>>>2]|=(a|c)<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),d((function(e,t){var n;e.exports=(n=at,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,s=t.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],c=e[t+1],h=e[t+2],f=e[t+3],g=e[t+4],m=e[t+5],y=e[t+6],v=e[t+7],b=e[t+8],w=e[t+9],_=e[t+10],k=e[t+11],I=e[t+12],E=e[t+13],A=e[t+14],C=e[t+15],P=o[0],T=o[1],O=o[2],S=o[3];P=u(P,T,O,S,s,7,a[0]),S=u(S,P,T,O,c,12,a[1]),O=u(O,S,P,T,h,17,a[2]),T=u(T,O,S,P,f,22,a[3]),P=u(P,T,O,S,g,7,a[4]),S=u(S,P,T,O,m,12,a[5]),O=u(O,S,P,T,y,17,a[6]),T=u(T,O,S,P,v,22,a[7]),P=u(P,T,O,S,b,7,a[8]),S=u(S,P,T,O,w,12,a[9]),O=u(O,S,P,T,_,17,a[10]),T=u(T,O,S,P,k,22,a[11]),P=u(P,T,O,S,I,7,a[12]),S=u(S,P,T,O,E,12,a[13]),O=u(O,S,P,T,A,17,a[14]),P=d(P,T=u(T,O,S,P,C,22,a[15]),O,S,c,5,a[16]),S=d(S,P,T,O,y,9,a[17]),O=d(O,S,P,T,k,14,a[18]),T=d(T,O,S,P,s,20,a[19]),P=d(P,T,O,S,m,5,a[20]),S=d(S,P,T,O,_,9,a[21]),O=d(O,S,P,T,C,14,a[22]),T=d(T,O,S,P,g,20,a[23]),P=d(P,T,O,S,w,5,a[24]),S=d(S,P,T,O,A,9,a[25]),O=d(O,S,P,T,f,14,a[26]),T=d(T,O,S,P,b,20,a[27]),P=d(P,T,O,S,E,5,a[28]),S=d(S,P,T,O,h,9,a[29]),O=d(O,S,P,T,v,14,a[30]),P=l(P,T=d(T,O,S,P,I,20,a[31]),O,S,m,4,a[32]),S=l(S,P,T,O,b,11,a[33]),O=l(O,S,P,T,k,16,a[34]),T=l(T,O,S,P,A,23,a[35]),P=l(P,T,O,S,c,4,a[36]),S=l(S,P,T,O,g,11,a[37]),O=l(O,S,P,T,v,16,a[38]),T=l(T,O,S,P,_,23,a[39]),P=l(P,T,O,S,E,4,a[40]),S=l(S,P,T,O,s,11,a[41]),O=l(O,S,P,T,f,16,a[42]),T=l(T,O,S,P,y,23,a[43]),P=l(P,T,O,S,w,4,a[44]),S=l(S,P,T,O,I,11,a[45]),O=l(O,S,P,T,C,16,a[46]),P=p(P,T=l(T,O,S,P,h,23,a[47]),O,S,s,6,a[48]),S=p(S,P,T,O,v,10,a[49]),O=p(O,S,P,T,A,15,a[50]),T=p(T,O,S,P,m,21,a[51]),P=p(P,T,O,S,I,6,a[52]),S=p(S,P,T,O,f,10,a[53]),O=p(O,S,P,T,_,15,a[54]),T=p(T,O,S,P,c,21,a[55]),P=p(P,T,O,S,b,6,a[56]),S=p(S,P,T,O,C,10,a[57]),O=p(O,S,P,T,y,15,a[58]),T=p(T,O,S,P,E,21,a[59]),P=p(P,T,O,S,g,6,a[60]),S=p(S,P,T,O,k,10,a[61]),O=p(O,S,P,T,h,15,a[62]),T=p(T,O,S,P,w,21,a[63]),o[0]=o[0]+P|0,o[1]=o[1]+T|0,o[2]=o[2]+O|0,o[3]=o[3]+S|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var d=c[u];c[u]=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<>>32-o)+t}function d(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<>>32-o)+t}function l(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<>>32-o)+t}function p(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)})),d((function(e,t){var n,r,i,o,s,a,c,u;e.exports=(r=(n=u=at).lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[],c=s.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],c=n[4],u=0;u<80;u++){if(u<16)a[u]=0|e[t+u];else{var d=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=d<<1|d>>>31}var l=(r<<5|r>>>27)+c+a[u];l+=u<20?1518500249+(i&o|~i&s):u<40?1859775393+(i^o^s):u<60?(i&o|i&s|o&s)-1894007588:(i^o^s)-899497514,c=s,s=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),u.SHA1)})),d((function(e,t){var n,r,i;e.exports=(r=(n=at).lib.Base,i=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,c=s.words,u=0;u>>2];e.sigBytes-=t}},o.BlockCipher=p.extend({cfg:p.cfg.extend({mode:g,padding:m}),reset:function(){p.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4}),y=o.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),v=(i.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=a.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(d)},parse:function(e){var t=d.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return y.create({ciphertext:t,salt:r})}},b=o.SerializableCipher=s.extend({cfg:s.extend({format:v}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),s=i.cfg;return y.create({ciphertext:o,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),w=(i.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=l.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,y.create({key:i,iv:o,salt:r})}},_=o.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:w}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=b.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,b.decrypt.call(this,e,t,i.key,r)}})))})),d((function(e,t){var n;e.exports=(n=at,function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],c=[],u=[],d=[],l=[],p=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var f=r^r<<1^r<<2^r<<3^r<<4;f=f>>>8^255&f^99,i[n]=f,o[f]=n;var g=e[n],m=e[g],y=e[m],v=257*e[f]^16843008*f;s[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*y^65537*m^257*g^16843008*n,d[f]=v<<24|v>>>8,l[f]=v<<16|v>>>16,p[f]=v<<8|v>>>24,h[f]=v,n?(n=g^e[e[e[y^g]]],r^=e[e[r]]):n=r=1}}();var f=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],s=0;s6&&s%n==4&&(a=i[a>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a]):(a=i[(a=a<<8|a>>>24)>>>24]<<24|i[a>>>16&255]<<16|i[a>>>8&255]<<8|i[255&a],a^=f[s/n|0]<<24),o[s]=o[s-n]^a}for(var c=this._invKeySchedule=[],u=0;u>>24]]^l[i[a>>>16&255]]^p[i[a>>>8&255]]^h[i[255&a]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,c,u,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,d,l,p,h,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var c=this._nRounds,u=e[t]^n[0],d=e[t+1]^n[1],l=e[t+2]^n[2],p=e[t+3]^n[3],h=4,f=1;f>>24]^i[d>>>16&255]^o[l>>>8&255]^s[255&p]^n[h++],m=r[d>>>24]^i[l>>>16&255]^o[p>>>8&255]^s[255&u]^n[h++],y=r[l>>>24]^i[p>>>16&255]^o[u>>>8&255]^s[255&d]^n[h++],v=r[p>>>24]^i[u>>>16&255]^o[d>>>8&255]^s[255&l]^n[h++];u=g,d=m,l=y,p=v}g=(a[u>>>24]<<24|a[d>>>16&255]<<16|a[l>>>8&255]<<8|a[255&p])^n[h++],m=(a[d>>>24]<<24|a[l>>>16&255]<<16|a[p>>>8&255]<<8|a[255&u])^n[h++],y=(a[l>>>24]<<24|a[p>>>16&255]<<16|a[u>>>8&255]<<8|a[255&d])^n[h++],v=(a[p>>>24]<<24|a[u>>>16&255]<<16|a[d>>>8&255]<<8|a[255&l])^n[h++],e[t]=g,e[t+1]=m,e[t+2]=y,e[t+3]=v},keySize:8});e.AES=t._createHelper(g)}(),n.AES)}))),ut=d((function(e,t){e.exports=at.enc.Utf8})),dt=Object.prototype.toString;var lt=function e(n){var r=function(e){switch(dt.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":null!=(n=e)&&(n._isBuffer||n.constructor&&"function"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n))?"buffer":t(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e));var n}(n);if("object"===r){var i={};for(var o in n)n.hasOwnProperty(o)&&(i[o]=e(n[o]));return i}if("array"===r){i=new Array(n.length);for(var s=0,a=n.length;s1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*mt;case"days":case"day":case"d":return n*gt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ft;case"minutes":case"minute":case"mins":case"min":case"m":return n*ht;case"seconds":case"second":case"secs":case"sec":case"s":return n*pt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return vt(e,gt,"day")||vt(e,ft,"hour")||vt(e,ht,"minute")||vt(e,pt,"second")||e+" ms"}(e):function(e){return e>=gt?Math.round(e/gt)+"d":e>=ft?Math.round(e/ft)+"h":e>=ht?Math.round(e/ht)+"m":e>=pt?Math.round(e/pt)+"s":e+"ms"}(e)};function vt(e,t,n){if(!(e=31},n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(r())}))),_t=(wt.log,wt.formatArgs,wt.save,wt.load,wt.useColors,wt.storage,wt.colors,wt("cookie")),kt=function(e,t,n){switch(arguments.length){case 3:case 2:return It(e,t,n);case 1:return At(e);default:return Et()}};function It(e,t,n){n=n||{};var r=Ct(e)+"="+Ct(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.samesite&&(r+="; samesite="+n.samesite),n.secure&&(r+="; secure"),document.cookie=r}function Et(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i1)))/4)-d((e-1901+t)/100)+d((e-1601+t)/400)};t=function(e){for(i=d(e/864e5),n=d(i/365.2425)+1970-1;h(n+1,0)<=i;n++);for(r=d((i-h(n,0))/30.42);h(n,r+1)<=i;r++);i=1+i-h(n,r),s=d((o=(e%864e5+864e5)%864e5)/36e5)%24,a=d(o/6e4)%60,c=d(o/1e3)%60,u=o%1e3}}return(A=function(e){return e>-1/0&&e<1/0?(t(e),e=(n<=0||n>=1e4?(n<0?"-":"+")+E(6,n<0?-n:n):E(4,n))+"-"+E(2,r+1)+"-"+E(2,i)+"T"+E(2,s)+":"+E(2,a)+":"+E(2,c)+"."+E(3,u)+"Z",n=r=i=s=a=c=u=null):e=null,e})(e)};if(w("json-stringify")&&!w("date-serialization")){var C=function(e){return A(this)},P=n.stringify;n.stringify=function(e,t,n){var r=u.prototype.toJSON;u.prototype.toJSON=C;var i=P(e,t,n);return u.prototype.toJSON=r,i}}else{var T=function(e){var t=e.charCodeAt(0),n=I[t];return n||"\\u00"+E(2,t.toString(16))},O=/[\x00-\x1f\x22\x5c]/g,S=function(e){return O.lastIndex=0,'"'+(O.test(e)?e.replace(O,T):e)+'"'};n.stringify=function(e,n,i){var o,s,a,c;if(r[t(n)]&&n)if("[object Function]"==(c=m.call(n)))s=n;else if("[object Array]"==c){a={};for(var d,p=0,h=n.length;p0)for(i>10&&(i=10),o="";o.length-1/0&&d<1/0?""+d:"null";case"string":case"[object String]":return S(""+d)}if("object"==t(d)){for(w=c.length;w--;)if(c[w]===d)throw l();if(c.push(d),g=[],_=a,a+=s,"[object Array]"==h){for(b=0,w=d.length;b=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||U();e+=j("0x"+o.slice(t,x));break;default:U()}else{if(34==i)break;for(i=o.charCodeAt(x),t=x;i>=32&&92!=i&&34!=i;)i=o.charCodeAt(++x);e+=o.slice(t,x)}if(34==o.charCodeAt(x))return x++,e;U();default:if(t=x,45==i&&(r=!0,i=o.charCodeAt(++x)),i>=48&&i<=57){for(48==i&&((i=o.charCodeAt(x+1))>=48&&i<=57)&&U(),r=!1;x=48&&i<=57);x++);if(46==o.charCodeAt(x)){for(n=++x;n57);n++);n==x&&U(),x=n}if(101==(i=o.charCodeAt(x))||69==i){for(43!=(i=o.charCodeAt(++x))&&45!=i||x++,n=x;n57);n++);n==x&&U(),x=n}return+o.slice(t,x)}r&&U();var a=o.slice(x,x+4);if("true"==a)return x+=4,!0;if("fals"==a&&101==o.charCodeAt(x+4))return x+=5,!1;if("null"==a)return x+=4,null;U()}return"$"},D=function(e,t,n){var r=N(e,t,n);r===f?delete e[t]:e[t]=r},N=function(e,n,r){var i,o=e[n];if("object"==t(o)&&o)if("[object Array]"==m.call(o))for(i=o.length;i--;)D(m,k,o);else k(o,(function(e){D(o,e,r)}));return r.call(e,n,o)};n.parse=function(e,t){var n,r;return x=0,R=""+e,n=function e(t){var n,r;if("$"==t&&U(),"string"==typeof t){if("@"==(_?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(n=[];"]"!=(t=M());)r?","==t?"]"==(t=M())&&U():U():r=!0,","==t&&U(),n.push(e(t));return n}if("{"==t){for(n={};"}"!=(t=M());)r?","==t?"}"==(t=M())&&U():U():r=!0,","!=t&&"string"==typeof t&&"@"==(_?t.charAt(0):t[0])&&":"==M()||U(),n[t.slice(1)]=e(M());return n}U()}return t}(M()),"$"!=M()&&U(),x=R=null,t&&"[object Function]"==m.call(t)?N(((r={})[""]=n,r),"",t):n}}}return n.runInContext=a,n}if(!s||s.global!==s&&s.window!==s&&s.self!==s||(o=s),i)a(o,i);else{var c=o.JSON,d=o.JSON3,l=!1,p=a(o,o.JSON3={noConflict:function(){return l||(l=!0,o.JSON=c,o.JSON3=d,c=d=null),p}});o.JSON={parse:p.parse,stringify:p.stringify}}}).call(u)})),Gt=1e3,Vt=60*Gt,Kt=60*Vt,Ht=24*Kt,Wt=365.25*Ht,Jt=function(e,t){return t=t||{},"string"==typeof e?function(e){if((e=""+e).length>1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*Wt;case"days":case"day":case"d":return n*Ht;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Kt;case"minutes":case"minute":case"mins":case"min":case"m":return n*Vt;case"seconds":case"second":case"secs":case"sec":case"s":return n*Gt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}(e):t.long?function(e){return $t(e,Ht,"day")||$t(e,Kt,"hour")||$t(e,Vt,"minute")||$t(e,Gt,"second")||e+" ms"}(e):function(e){return e>=Ht?Math.round(e/Ht)+"d":e>=Kt?Math.round(e/Kt)+"h":e>=Vt?Math.round(e/Vt)+"m":e>=Gt?Math.round(e/Gt)+"s":e+"ms"}(e)};function $t(e,t,n){if(!(e=31},n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(r())}))),Zt=(Qt.log,Qt.formatArgs,Qt.save,Qt.load,Qt.useColors,Qt.storage,Qt.colors,Qt("cookie")),Xt=function(e,t,n){switch(arguments.length){case 3:case 2:return en(e,t,n);case 1:return nn(e);default:return tn()}};function en(e,t,n){n=n||{};var r=rn(e)+"="+rn(t);null==t&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(r+="; path="+n.path),n.domain&&(r+="; domain="+n.domain),n.expires&&(r+="; expires="+n.expires.toUTCString()),n.secure&&(r+="; secure"),document.cookie=r}function tn(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},r=e.split(/ *; */);if(""==r[0])return n;for(var i=0;i=0;--o)i.push(t.slice(o).join("."));return i},r.cookie=Xt,t=e.exports=r})),an=new(function(){function e(t){n(this,e),this._options={},this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;var t=".".concat(sn(window.location.href));"."===t&&(t=null),this._options=qt(e,{maxage:31536e6,path:"/",domain:t,samesite:"Lax"}),this.set("test_rudder",!0),this.get("test_rudder")||(this._options.domain=null),this.remove("test_rudder")}},{key:"set",value:function(e,t){try{return kt(e,t,lt(this._options)),!0}catch(e){return z.error(e),!1}}},{key:"get",value:function(e){return kt(e)}},{key:"remove",value:function(e){try{return kt(e,null,lt(this._options)),!0}catch(e){return!1}}}]),e}())({}),cn=function(){var e,t={},n="undefined"!=typeof window?window:u,r=n.document,i="localStorage";if(t.disabled=!1,t.version="1.3.20",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,n,r){null==r&&(r=n,n=null),null==n&&(n={});var i=t.get(e,n);r(i),t.set(e,i)},t.getAll=function(){var e={};return t.forEach((function(t,n){e[t]=n})),e},t.forEach=function(){},t.serialize=function(e){return zt.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return zt.parse(e)}catch(t){return e||void 0}},function(){try{return i in n&&n[i]}catch(e){return!1}}())e=n[i],t.set=function(n,r){return void 0===r?t.remove(n):(e.setItem(n,t.serialize(r)),r)},t.get=function(n,r){var i=t.deserialize(e.getItem(n));return void 0===i?r:i},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.forEach=function(n){for(var r=0;rdocument.w=window<\/script>'),s.close(),o=s.w.frames[0].document,e=o.createElement("div")}catch(t){e=r.createElement("div"),o=r.body}var a=function(n){return function(){var r=Array.prototype.slice.call(arguments,0);r.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(i);var s=n.apply(t,r);return o.removeChild(e),s}},c=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),d=function(e){return e.replace(/^d/,"___$&").replace(c,"___")};t.set=a((function(e,n,r){return n=d(n),void 0===r?t.remove(n):(e.setAttribute(n,t.serialize(r)),e.save(i),r)})),t.get=a((function(e,n,r){n=d(n);var i=t.deserialize(e.getAttribute(n));return void 0===i?r:i})),t.remove=a((function(e,t){t=d(t),e.removeAttribute(t),e.save(i)})),t.clear=a((function(e){var t=e.XMLDocument.documentElement.attributes;e.load(i);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(i)})),t.forEach=a((function(e,n){for(var r,i=e.XMLDocument.documentElement.attributes,o=0;r=i[o];++o)n(r.name,t.deserialize(e.getAttribute(r.name)))}))}try{var l="__storejs__";t.set(l,l),t.get(l)!=l&&(t.disabled=!0),t.remove(l)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,t}(),un=new(function(){function e(t){n(this,e),this._options={},this.enabled=!1,this.options(t)}return i(e,[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this._options;qt(e,{enabled:!0}),this.enabled=e.enabled&&cn.enabled,this._options=e}},{key:"set",value:function(e,t){return!!this.enabled&&cn.set(e,t)}},{key:"get",value:function(e){return this.enabled?cn.get(e):null}},{key:"remove",value:function(e){return!!this.enabled&&cn.remove(e)}}]),e}())({}),dn="rl_user_id",ln="rl_trait",pn="rl_anonymous_id",hn="rl_group_id",fn="rl_group_trait",gn="RudderEncrypt:",mn="Rudder",yn=new(function(){function e(){if(n(this,e),an.set("rudder_cookies",!0),an.get("rudder_cookies"))return an.remove("rudder_cookies"),void(this.storage=an);un.enabled&&(this.storage=un)}return i(e,[{key:"stringify",value:function(e){return JSON.stringify(e)}},{key:"parse",value:function(e){try{return e?JSON.parse(e):null}catch(t){return z.error(t),e||null}}},{key:"trim",value:function(e){return e.replace(/^\s+|\s+$/gm,"")}},{key:"encryptValue",value:function(e){return""==this.trim(e)?e:"".concat(gn).concat(ct.encrypt(e,mn).toString())}},{key:"decryptValue",value:function(e){return!e||"string"==typeof e&&""==this.trim(e)?e:e.substring(0,gn.length)==gn?ct.decrypt(e.substring(gn.length),mn).toString(ut):e}},{key:"setItem",value:function(e,t){this.storage.set(e,this.encryptValue(this.stringify(t)))}},{key:"setUserId",value:function(e){"string"==typeof e?this.storage.set(dn,this.encryptValue(this.stringify(e))):z.error("[Storage] setUserId:: userId should be string")}},{key:"setUserTraits",value:function(e){this.storage.set(ln,this.encryptValue(this.stringify(e)))}},{key:"setGroupId",value:function(e){"string"==typeof e?this.storage.set(hn,this.encryptValue(this.stringify(e))):z.error("[Storage] setGroupId:: groupId should be string")}},{key:"setGroupTraits",value:function(e){this.storage.set(fn,this.encryptValue(this.stringify(e)))}},{key:"setAnonymousId",value:function(e){"string"==typeof e?this.storage.set(pn,this.encryptValue(this.stringify(e))):z.error("[Storage] setAnonymousId:: anonymousId should be string")}},{key:"getItem",value:function(e){return this.parse(this.decryptValue(this.storage.get(e)))}},{key:"getUserId",value:function(){return this.parse(this.decryptValue(this.storage.get(dn)))}},{key:"getUserTraits",value:function(){return this.parse(this.decryptValue(this.storage.get(ln)))}},{key:"getGroupId",value:function(){return this.parse(this.decryptValue(this.storage.get(hn)))}},{key:"getGroupTraits",value:function(){return this.parse(this.decryptValue(this.storage.get(fn)))}},{key:"getAnonymousId",value:function(){return this.parse(this.decryptValue(this.storage.get(pn)))}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"clear",value:function(){this.storage.remove(dn),this.storage.remove(ln),this.storage.remove(hn),this.storage.remove(fn)}}]),e}()),vn="lt_synch_timestamp",bn=new(function(){function e(){n(this,e),this.storage=yn}return i(e,[{key:"setLotameSynchTime",value:function(e){this.storage.setItem(vn,e)}},{key:"getLotameSynchTime",value:function(){return this.storage.getItem(vn)}}]),e}()),wn=function(){function e(t,r){var i=this;n(this,e),this.name="LOTAME",this.analytics=r,this.storage=bn,this.bcpUrlSettingsPixel=t.bcpUrlSettingsPixel,this.bcpUrlSettingsIframe=t.bcpUrlSettingsIframe,this.dspUrlSettingsPixel=t.dspUrlSettingsPixel,this.dspUrlSettingsIframe=t.dspUrlSettingsIframe,this.mappings={},t.mappings.forEach((function(e){var t=e.key,n=e.value;i.mappings[t]=n}))}return i(e,[{key:"init",value:function(){z.debug("===in init Lotame==="),window.LOTAME_SYNCH_CALLBACK=function(){}}},{key:"addPixel",value:function(e,t,n){z.debug("Adding pixel for :: ".concat(e));var r=document.createElement("img");r.src=e,r.setAttribute("width",t),r.setAttribute("height",n),z.debug("Image Pixel :: ".concat(r)),document.getElementsByTagName("body")[0].appendChild(r)}},{key:"addIFrame",value:function(e){z.debug("Adding iframe for :: ".concat(e));var t=document.createElement("iframe");t.src=e,t.title="empty",t.setAttribute("id","LOTCCFrame"),t.setAttribute("tabindex","-1"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.setAttribute("style","border: 0px; width: 0px; height: 0px; display: block;"),z.debug("IFrame :: ".concat(t)),document.getElementsByTagName("body")[0].appendChild(t)}},{key:"syncPixel",value:function(e){var t=this;if(z.debug("===== in syncPixel ======"),z.debug("Firing DSP Pixel URLs"),this.dspUrlSettingsPixel&&this.dspUrlSettingsPixel.length>0){var n=Date.now();this.dspUrlSettingsPixel.forEach((function(r){var i=t.compileUrl(a({},t.mappings,{userId:e,random:n}),r.dspUrlTemplate);t.addPixel(i,"1","1")}))}if(z.debug("Firing DSP IFrame URLs"),this.dspUrlSettingsIframe&&this.dspUrlSettingsIframe.length>0){var r=Date.now();this.dspUrlSettingsIframe.forEach((function(n){var i=t.compileUrl(a({},t.mappings,{userId:e,random:r}),n.dspUrlTemplate);t.addIFrame(i)}))}this.storage.setLotameSynchTime(Date.now()),this.analytics.methodToCallbackMapping.syncPixel&&this.analytics.emit("syncPixel",{destination:this.name})}},{key:"compileUrl",value:function(e,t){return Object.keys(e).forEach((function(n){if(e.hasOwnProperty(n)){var r="{{".concat(n,"}}"),i=new RegExp(r,"gi");t=t.replace(i,e[n])}})),t}},{key:"identify",value:function(e){z.debug("in Lotame identify");var t=e.message.userId;this.syncPixel(t)}},{key:"track",value:function(e){z.debug("track not supported for lotame")}},{key:"page",value:function(e){var t=this;if(z.debug("in Lotame page"),z.debug("Firing BCP Pixel URLs"),this.bcpUrlSettingsPixel&&this.bcpUrlSettingsPixel.length>0){var n=Date.now();this.bcpUrlSettingsPixel.forEach((function(e){var r=t.compileUrl(a({},t.mappings,{random:n}),e.bcpUrlTemplate);t.addPixel(r,"1","1")}))}if(z.debug("Firing BCP IFrame URLs"),this.bcpUrlSettingsIframe&&this.bcpUrlSettingsIframe.length>0){var r=Date.now();this.bcpUrlSettingsIframe.forEach((function(e){var n=t.compileUrl(a({},t.mappings,{random:r}),e.bcpUrlTemplate);t.addIFrame(n)}))}e.message.userId&&this.isPixelToBeSynched()&&this.syncPixel(e.message.userId)}},{key:"isPixelToBeSynched",value:function(){var e=this.storage.getLotameSynchTime(),t=Date.now();return!e||Math.floor((t-e)/864e5)>=7}},{key:"isLoaded",value:function(){return z.debug("in Lotame isLoaded"),!0}},{key:"isReady",value:function(){return!0}}]),e}(),_n=function(){function e(t,r){var i=this;n(this,e),this.referrerOverride=function(e){if(e)return window.optimizelyEffectiveReferrer=e,e},this.sendDataToRudder=function(e){z.debug(e);var t=e.experiment,n=e.variation,r={integrations:{All:!0}},o=e.audiences,s={};o.forEach((function(e){s[e.id]=e.name}));var a=Object.keys(s).sort().join(),c=Object.values(s).sort().join(", ");if(i.sendExperimentTrack){var u={campaignName:e.campaignName,campaignId:e.id,experimentId:t.id,experimentName:t.name,variationName:n.name,variationId:n.id,audienceId:a,audienceName:c,isInCampaignHoldback:e.isInCampaignHoldback};if(t.referrer&&(u.referrer=t.referrer,r.page={referrer:t.referrer}),i.sendExperimentTrackAsNonInteractive&&(u.nonInteraction=1),e&&i.customCampaignProperties.length>0)for(var d=0;d1){var n=t.pop();switch(n){case"str":case"int":case"date":case"real":case"bool":case"strs":case"ints":case"dates":case"reals":case"bools":return"".concat(En(t.join("_")),"_").concat(n)}}return En(e)}}]),e}(),Pn=function(){function e(t){n(this,e),this.isLoaded=function(){return z.debug("in TVSqaured isLoaded"),!(!window._tvq||window._tvq.push===Array.prototype.push)},this.isReady=function(){return z.debug("in TVSqaured isReady"),!(!window._tvq||window._tvq.push===Array.prototype.push)},this.page=function(){window._tvq.push(["trackPageView"])},this.formatRevenue=function(e){var t=e;return t=parseFloat(t.toString().replace(/^[^\d.]*/,""))},this.brandId=t.brandId,this.clientId=t.clientId,this.eventWhiteList=t.eventWhiteList||[],this.customMetrics=t.customMetrics||[],this.name="TVSquared"}return i(e,[{key:"init",value:function(){z.debug("===in init TVSquared==="),window._tvq=window._tvq||[];var e="https:"===document.location.protocol?"https://":"http://";e+="collector-".concat(this.clientId,".tvsquared.com/"),window._tvq.push(["setSiteId",this.brandId]),window._tvq.push(["setTrackerUrl","".concat(e,"tv2track.php")]),le("TVSquared-integration","".concat(e,"tv2track.js"))}},{key:"track",value:function(e){var t,n,r=e.message,i=r.event,o=r.userId,s=r.anonymousId,a=e.message.properties,c=a.revenue,u=a.productType,d=a.category,l=a.order_id,p=a.promotion_id,h=this.eventWhiteList.slice();for(h=h.filter((function(e){return""!==e.event})),t=0;t2&&void 0!==arguments[2])||arguments[2],r={};return Object.keys(e).forEach((function(i){t.forEach((function(t){i===t.src&&(t.inItems&&n&&(r=function(e,t,n){var r=e;return r.items?r.items[0][t]=n:(r.items=[],r.items.push(o({},t,n))),r}(r,t.dest,e[i])),r[t.dest]=e[i],delete e[i])}))})),r}function Mn(e){return Un(e,Ln)}for(var Dn=function(){function e(t,r){n(this,e),this.measurementId=t.measurementId,this.analytics=r,this.sendUserId=t.sendUserId||!1,this.blockPageView=t.blockPageViewEvent||!1,this.extendPageViewParams=t.extendPageViewParams||!1,this.name="GA4"}return i(e,[{key:"loadScript",value:function(e,t){window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)},window.gtag("js",new Date),this.blockPageView?this.sendUserId?window.gtag("config",e,{user_id:t,send_page_view:!1}):window.gtag("config",e,{send_page_view:!1}):this.sendUserId?window.gtag("config",e,{user_id:t}):window.gtag("config",e),le("google-analytics 4","https://www.googletagmanager.com/gtag/js?id=".concat(e))}},{key:"init",value:function(){var e=this.analytics.userId||this.analytics.anonymousId;this.loadScript(this.measurementId,e)}},{key:"isLoaded",value:function(){return!(!window.gtag||window.gtag.push===Array.prototype.push)}},{key:"isReady",value:function(){return!(!window.gtag||window.gtag.push===Array.prototype.push)}},{key:"getdestinationProperties",value:function(e,t,n,r){var i={};return i=Un(e,r,t),t&&(i.items=function(e,t){var n=[],r={};return"array"!==ae(e)?z.debug("Event payload doesn't have products array"):e.forEach((function(e){r=a({},Un(e,Rn),{},t&&"array"===ae(t)&&t[0]||{}),n.push(r)})),n}(n||[e],i.items)),i}},{key:"getIncludedParameters",value:function(e,t){var n={};if("object"===ae(e)){var r=e.defaults,i=e.mappings;"object"===ae(r)&&Object.keys(r).forEach((function(e){n[e]=r[e]})),"object"===ae(i)&&Object.keys(i).forEach((function(e){n[i[e]]=t[e]}))}return n}},{key:"sendGAEvent",value:function(e,t,n,r){if(n&&!function(e,t){var n=t.requiredParams||!1;if(!n)return!0;if(!Array.isArray(n))return!!e[n];for(var r in e.items)for(var i in n)if(!e.items[r][n[i]])return!1;return!0}(t,r))throw Error("Payload must have required parameters..");window.gtag("event",e,t)}},{key:"handleEventMapper",value:function(e,t,n){var r={},i=e.dest;if(e.onlyIncludeParams){var o=e.onlyIncludeParams;r=this.getIncludedParameters(o,t)}else r=this.getdestinationProperties(t,e.hasItem,n,e.includeList);this.sendGAEvent(i,r,!0,e)}},{key:"track",value:function(e){var t=this,n=e.message.event,r=e.message.properties,i=r.products;if(!n||["ad_activeview","ad_click","ad_exposure","ad_impression","ad_query","adunit_exposure","app_clear_data","app_install","app_update","app_remove","error","first_open","first_visit","in_app_purchase","notification_dismiss","notification_foreground","notification_open","notification_receive","os_update","screen_view","session_start","user_engagement"].includes(n))throw Error("Cannot call un-named/reserved named track event");var o=function(e){return jn.filter((function(t){return t.src.includes(e.toLowerCase())}))}(n);o&&o.length?o.forEach((function(e){t.handleEventMapper(e,r,i)})):this.sendGAEvent(n,ce(r),!1)}},{key:"identify",value:function(e){if(window.gtag("set","user_properties",ce(this.analytics.userTraits)),this.sendUserId&&e.message.userId){var t=this.analytics.userId||this.analytics.anonymousId;this.blockPageView?window.gtag("config",this.measurementId,{user_id:t,send_page_view:!1}):window.gtag("config",this.measurementId,{user_id:t})}z.debug("in GoogleAnalyticsManager identify")}},{key:"page",value:function(e){var t=e.message.properties;t&&(t=ce(t),this.extendPageViewParams?window.gtag("event","page_view",a({},t,{},Mn(t))):window.gtag("event","page_view",Mn(t)))}}]),e}(),Nn={firstName:"first_name",lastName:"last_name",firstname:"first_name",lastname:"last_name",email:"email",phone:"mobile",name:"user_name",username:"user_name",userName:"user_name",gender:"gender",birthday:"birthday",id:null},Bn=function(){function e(t,r){n(this,e),this.isLoaded=function(){return z.debug("in MoEngage isLoaded"),!!window.moeBannerText},this.isReady=function(){return z.debug("in MoEngage isReady"),!!window.moeBannerText},this.apiId=t.apiId,this.debug=t.debug,this.region=t.region,this.name="MoEngage",this.analyticsinstance=r}return i(e,[{key:"init",value:function(){z.debug("===in init MoEnagage==="),function(e,t,n,r,i,o,s,a){e.moengage_object=i;var c={},u=function(t){return function(){(e.moengage_q=e.moengage_q||[]).push({f:t,a:arguments})}},d=["track_event","add_user_attribute","add_first_name","add_last_name","add_email","add_mobile","add_user_name","add_gender","add_birthday","destroy_session","add_unique_user_id","moe_events","call_web_push","track","location_type_attribute"],l={onsite:["getData","registerCallback"]};for(var p in d)c[d[p]]=u(d[p]);for(var p in l)for(var h in l[p])null==c[p]&&(c[p]={}),c[p][l[p][h]]=u(p+"."+l[p][h]);o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src=r,s.parentNode.insertBefore(o,s),e.moe=e.moe||function(){return a=arguments[0],c},o.onload=function(){a&&(e[i]=moe(a))}}(window,document,"script","https:"===document.location.protocol?"https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js":"http://cdn.moengage.com/webpush/moe_webSdk.min.latest.js","Moengage"),"US"!==this.region?this.moeClient=window.moe({app_id:this.apiId,debug_logs:this.debug?1:0,cluster:"EU"===this.region?"eu":"in"}):this.moeClient=window.moe({app_id:this.apiId,debug_logs:this.debug?1:0}),this.initialUserId=this.analyticsinstance.userId}},{key:"track",value:function(e){if(z.debug("inside track"),e.message){var t=e.message,n=t.event,r=t.properties,i=t.userId;i&&this.initialUserId!==i&&this.reset(),n?r?this.moeClient.track_event(n,r):this.moeClient.track_event(n):z.error("Event name not present")}else z.error("Payload not correct")}},{key:"reset",value:function(){z.debug("inside reset"),this.initialUserId=this.analyticsinstance.userId,this.moeClient.destroy_session()}},{key:"identify",value:function(e){var t=this,n=e.message.userId,r=null;e.message.context&&(r=e.message.context.traits),this.initialUserId!==n&&this.reset(),n&&this.moeClient.add_unique_user_id(n),r&&x((function(e,n){if("name"===n&&t.moeClient.add_user_name(e),Object.prototype.hasOwnProperty.call(Nn,n)){var r="add_".concat(Nn[n]);t.moeClient[r](e)}else t.moeClient.add_user_attribute(n,e)}),r)}}]),e}(),qn=function(){function e(t,r){var i=this;n(this,e),this.name="AM",this.analytics=r,this.apiKey=t.apiKey,this.trackAllPages=t.trackAllPages||!1,this.trackNamedPages=t.trackNamedPages||!1,this.trackCategorizedPages=t.trackCategorizedPages||!1,this.trackUtmProperties=t.trackUtmProperties||!1,this.trackReferrer=t.trackReferrer||!1,this.batchEvents=t.batchEvents||!1,this.eventUploadThreshold=+t.eventUploadThreshold||30,this.eventUploadPeriodMillis=+t.eventUploadPeriodMillis||3e4,this.forceHttps=t.forceHttps||!1,this.trackGclid=t.trackGclid||!1,this.saveParamsReferrerOncePerSession=t.saveParamsReferrerOncePerSession||!1,this.deviceIdFromUrlParam=t.deviceIdFromUrlParam||!1,this.trackRevenuePerProduct=t.trackRevenuePerProduct||!1,this.preferAnonymousIdForDeviceId=t.preferAnonymousIdForDeviceId||!1,this.traitsToSetOnce=[],this.traitsToIncrement=[],this.appendFieldsToEventProps=t.appendFieldsToEventProps||!1,this.unsetParamsReferrerOnNewSession=t.unsetParamsReferrerOnNewSession||!1,this.trackProductsOnce=t.trackProductsOnce||!1,this.versionName=t.versionName,t.traitsToSetOnce&&t.traitsToSetOnce.length>0&&t.traitsToSetOnce.forEach((function(e){e&&e.traits&&""!==e.traits&&i.traitsToSetOnce.push(e.traits)})),t.traitsToIncrement&&t.traitsToIncrement.length>0&&t.traitsToIncrement.forEach((function(e){e&&e.traits&&""!==e.traits&&i.traitsToIncrement.push(e.traits)}))}return i(e,[{key:"init",value:function(){!function(e,t){var n=e.amplitude||{_q:[],_iq:{}},r=t.createElement("script");r.type="text/javascript",r.integrity="sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M",r.crossOrigin="anonymous",r.async=!0,r.src="https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js",r.onload=function(){e.amplitude.runQueuedFunctions||console.log("[Amplitude] Error: could not load SDK")};var i=t.getElementsByTagName("script")[0];function o(e,t){e.prototype[t]=function(){return this._q.push([t].concat(Array.prototype.slice.call(arguments,0))),this}}i.parentNode.insertBefore(r,i);for(var s=function(){return this._q=[],this},a=["add","append","clearAll","prepend","set","setOnce","unset"],c=0;c=0,s=this.traitsToSetOnce.indexOf(i)>=0;o&&r.add(i,t[i]),s&&r.setOnce(i,t[i]),o||s||r.set(i,t[i])}window.amplitude.identify(r)}}},{key:"track",value:function(e){z.debug("in Amplitude track"),this.setDeviceId(e);var t=e.message.properties.products,n={};if(Object.assign(n,e.message),this.trackProductsOnce)if(t&&"array"==ae(t)){for(var r=[],i=Object.keys(t),o=0;o>>((3&t)<<3)&255;return r}}})),Qn=[],Zn=0;Zn<256;++Zn)Qn[Zn]=(Zn+256).toString(16).substr(1);var Xn,er,tr=function(e,t){var n=t||0,r=Qn;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")},nr=0,rr=0;var ir=function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||Xn,s=void 0!==e.clockseq?e.clockseq:er;if(null==o||null==s){var a=Yn();null==o&&(o=Xn=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==s&&(s=er=16383&(a[6]<<8|a[7]))}var c=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:rr+1,d=c-nr+(u-rr)/1e4;if(d<0&&void 0===e.clockseq&&(s=s+1&16383),(d<0||c>nr)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");nr=c,rr=u,er=s;var l=(1e4*(268435455&(c+=122192928e5))+u)%4294967296;i[r++]=l>>>24&255,i[r++]=l>>>16&255,i[r++]=l>>>8&255,i[r++]=255&l;var p=c/4294967296*1e4&268435455;i[r++]=p>>>8&255,i[r++]=255&p,i[r++]=p>>>24&15|16,i[r++]=p>>>16&255,i[r++]=s>>>8|128,i[r++]=255&s;for(var h=0;h<6;++h)i[r+h]=o[h];return t||tr(i)};var or=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||Yn)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||tr(i)},sr=or;sr.v1=ir,sr.v4=or;var ar=sr,cr=ar.v4,ur={_data:{},length:0,setItem:function(e,t){return this._data[e]=t,this.length=A(this._data).length,t},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(e){return e in this._data&&delete this._data[e],this.length=A(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(e){return A(this._data)[e]}};var dr={defaultEngine:function(){try{if(!window.localStorage)return!1;var e=cr();window.localStorage.setItem(e,"test_value");var t=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===t}catch(e){return!1}}()?window.localStorage:ur,inMemoryEngine:ur},lr=dr.defaultEngine,pr=dr.inMemoryEngine;function hr(e,t,n,r){this.id=t,this.name=e,this.keys=n||{},this.engine=r||lr}hr.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,zt.stringify(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},hr.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:zt.parse(t)}catch(e){return null}},hr.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},hr.prototype._createValidKey=function(e){var t,n=this.name,r=this.id;return A(this.keys).length?(x((function(i){i===e&&(t=[n,r,e].join("."))}),this.keys),t):[n,r,e].join(".")},hr.prototype._swapEngine=function(){var e=this;x((function(t){var n=e.get(t);pr.setItem([e.name,e.id,t].join("."),n),e.remove(t)}),this.keys),this.engine=pr};var fr=hr;var gr={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},mr=gr;function yr(){this.tasks={},this.nextId=1}yr.prototype.now=function(){return+new mr.Date},yr.prototype.run=function(e,t){var n=this.nextId++;return this.tasks[n]=mr.setTimeout(this._handle(n,e),t),n},yr.prototype.cancel=function(e){this.tasks[e]&&(mr.clearTimeout(this.tasks[e]),delete this.tasks[e])},yr.prototype.cancelAll=function(){x(mr.clearTimeout,this.tasks),this.tasks={}},yr.prototype._handle=function(e,t){var n=this;return function(){return delete n.tasks[e],t()}},yr.setClock=function(e){mr=e},yr.resetClock=function(){mr=gr};var vr=yr,br=wr;function wr(e){return wr.enabled(e)?function(t){t=_r(t);var n=new Date,r=n-(wr[e]||n);wr[e]=n,t=e+" "+t+" +"+wr.humanize(r),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}function _r(e){return e instanceof Error?e.stack||e.message:e}wr.names=[],wr.skips=[],wr.enable=function(e){try{localStorage.debug=e}catch(e){}for(var t=(e||"").split(/[\s,]+/),n=t.length,r=0;r=36e5?(e/36e5).toFixed(1)+"h":e>=6e4?(e/6e4).toFixed(1)+"m":e>=1e3?(e/1e3|0)+"s":e+"ms"},wr.enabled=function(e){for(var t=0,n=wr.skips.length;tthis.maxAttempts)},Cr.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},Cr.prototype.addItem=function(e){this._enqueue({item:e,attemptNumber:0,time:this._schedule.now()})},Cr.prototype.requeue=function(e,t,n){this.shouldRetry(e,t,n)?this._enqueue({item:e,attemptNumber:t,time:this._schedule.now()+this.getDelay(t)}):this.emit("discard",e,t)},Cr.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort((function(e,t){return e.time-t.time})),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},Cr.prototype._processHead=function(){var e=this,t=this._store;this._schedule.cancel(this._processId);var n=t.get(this.keys.QUEUE)||[],r=t.get(this.keys.IN_PROGRESS)||{},i=this._schedule.now(),o=[];function s(n,r){o.push({item:n.item,done:function(i,o){var s=t.get(e.keys.IN_PROGRESS)||{};delete s[r],t.set(e.keys.IN_PROGRESS,s),e.emit("processed",i,o,n.item),i&&e.requeue(n.item,n.attemptNumber+1,i)}})}for(var a=Object.keys(r).length;n.length&&n[0].time<=i&&a++0&&(this._processId=this._schedule.run(this._processHead,n[0].time-i))},Cr.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER)},Cr.prototype._checkReclaim=function(){var e=this;x((function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)=500&&o.status<600?(Q(new Error("request failed with status: ".concat(o.status).concat(o.statusText," for url: ").concat(e))),i(new Error("request failed with status: ".concat(o.status).concat(o.statusText," for url: ").concat(e)))):(z.debug("====== request processed successfully: ".concat(o.status)),i(null,o.status)))},o.send(JSON.stringify(n,J))}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n=e.getElementContent(),r={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(this.writeKey,":"))),AnonymousId:btoa(n.anonymousId)};n.originalTimestamp=Y(),n.sentAt=Y(),JSON.stringify(n).length>32e3&&z.error("[EventRepository] enqueue:: message length greater 32 Kb ",n);var i="/"==this.url.slice(-1)?this.url.slice(0,-1):this.url;this.payloadQueue.addItem({url:"".concat(i,"/v1/").concat(t),headers:r,message:n})}}]),e}());function xr(e){z.error("[AutoTrack]: This functionality has been moved to a different deployment")}var Rr={trait:"ajs_trait_",prop:"ajs_prop_"};function jr(e,t){this.eventRepository||(this.eventRepository=Sr),this.eventRepository.enqueue(e,t)}var Lr=new(function(){function e(){n(this,e),this.autoTrackHandlersRegistered=!1,this.autoTrackFeatureEnabled=!1,this.initialized=!1,this.trackValues=[],this.eventsBuffer=[],this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=yn,this.eventRepository=Sr,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallback=function(){},this.executeReadyCallback=void 0,this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1}return i(e,[{key:"initializeUser",value:function(){this.userId=null!=this.storage.getUserId()?this.storage.getUserId():"",this.userTraits=null!=this.storage.getUserTraits()?this.storage.getUserTraits():{},this.groupId=null!=this.storage.getGroupId()?this.storage.getGroupId():"",this.groupTraits=null!=this.storage.getGroupTraits()?this.storage.getGroupTraits():{},this.anonymousId=this.getAnonymousId(),this.storage.setUserId(this.userId),this.storage.setAnonymousId(this.anonymousId),this.storage.setGroupId(this.groupId),this.storage.setUserTraits(this.userTraits),this.storage.setGroupTraits(this.groupTraits)}},{key:"processResponse",value:function(e,t){try{z.debug("===in process response=== ".concat(e)),(t=JSON.parse(t)).source.useAutoTracking&&!this.autoTrackHandlersRegistered&&(this.autoTrackFeatureEnabled=!0,xr(),this.autoTrackHandlersRegistered=!0),t.source.destinations.forEach((function(e,t){z.debug("Destination ".concat(t," Enabled? ").concat(e.enabled," Type: ").concat(e.destinationDefinition.name," Use Native SDK? ").concat(e.config.useNativeSDK)),e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config})}),this),z.debug("this.clientIntegrations: ",this.clientIntegrations),this.clientIntegrations=ne(this.loadOnlyIntegrations,this.clientIntegrations),this.clientIntegrations=this.clientIntegrations.filter((function(e){return null!=Fn[e.name]})),this.init(this.clientIntegrations)}catch(e){Q(e),z.debug("===handling config BE response processing error==="),z.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(xr(),this.autoTrackHandlersRegistered=!0)}}},{key:"init",value:function(e){var t=this,n=this;if(z.debug("supported intgs ",Fn),!e||0==e.length)return this.readyCallback&&this.readyCallback(),void(this.toBeProcessedByIntegrationArray=[]);e.forEach((function(e){try{z.debug("[Analytics] init :: trying to initialize integration name:: ",e.name);var r=new(0,Fn[e.name])(e.config,n);r.init(),z.debug("initializing destination: ",e),t.isInitialized(r).then(t.replayEvents)}catch(t){z.error("[Analytics] initialize integration (integration.init()) failed :: ",e.name)}}))}},{key:"replayEvents",value:function(e){e.successfullyLoadedIntegration.length+e.failedToBeLoadedIntegration.length===e.clientIntegrations.length&&(z.debug("===replay events called====",e.successfullyLoadedIntegration.length,e.failedToBeLoadedIntegration.length),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration,z.debug("==registering after callback===",e.clientIntegrationObjects.length),e.executeReadyCallback=p(e.clientIntegrationObjects.length,e.readyCallback),z.debug("==registering ready callback==="),e.on("ready",e.executeReadyCallback),e.clientIntegrationObjects.forEach((function(t){z.debug("===looping over each successful integration===="),t.isReady&&!t.isReady()||(z.debug("===letting know I am ready=====",t.name),e.emit("ready"))})),e.toBeProcessedByIntegrationArray.length>0&&(e.toBeProcessedByIntegrationArray.forEach((function(t){var n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&te(t[0].message.integrations);for(var r=ne(t[0].message.integrations,e.clientIntegrationObjects),i=0;i1&&void 0!==arguments[1]?arguments[1]:0;return new Promise((function(r){return e.isLoaded()?(z.debug("===integration loaded successfully====",e.name),t.successfullyLoadedIntegration.push(e),r(t)):n>=1e4?(z.debug("====max wait over===="),t.failedToBeLoadedIntegration.push(e),r(t)):void t.pause(1e3).then((function(){return z.debug("====after pause, again checking===="),t.isInitialized(e,n+1e3).then(r)}))}))}},{key:"page",value:function(e,n,r,i,o){this.loaded&&("function"==typeof i&&(o=i,i=null),"function"==typeof r&&(o=r,i=r=null),"function"==typeof n&&(o=n,i=r=n=null),"object"===t(e)&&null!=e&&null!=e&&(i=n,r=e,n=e=null),"object"===t(n)&&null!=n&&null!=n&&(i=r,r=n,n=null),"string"==typeof e&&"string"!=typeof n&&(n=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!=e&&this.sendSampleRequest(),this.processPage(e,n,r,i,o))}},{key:"track",value:function(e,t,n,r){this.loaded&&("function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),this.processTrack(e,t,n,r))}},{key:"identify",value:function(e,n,r,i){this.loaded&&("function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"===t(e)&&(r=n,n=e,e=this.userId),this.processIdentify(e,n,r,i))}},{key:"alias",value:function(e,n,r,i){if(this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"===t(n)&&(r=n,n=null);var o=(new $n).setType("alias").build();o.message.previousId=n||(this.userId?this.userId:this.getAnonymousId()),o.message.userId=e,this.processAndSendDataToDestinations("alias",o,r,i)}}},{key:"group",value:function(e,n,r,i){if(this.loaded&&arguments.length){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=null,n=null),"object"===t(e)&&(r=n,n=e,e=this.groupId),this.groupId=e,this.storage.setGroupId(this.groupId);var o=(new $n).setType("group").build();if(n)for(var s in n)this.groupTraits[s]=n[s];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,r,i)}}},{key:"processPage",value:function(e,t,n,r,i){var o=(new $n).setType("page").build();n||(n={}),t&&(o.message.name=t,n.name=t),e&&(o.message.category=e,n.category=e),o.message.properties=this.getPageProperties(n),this.trackPage(o,r,i)}},{key:"processTrack",value:function(e,t,n,r){var i=(new $n).setType("track").build();e&&i.setEventName(e),t?i.setProperty(t):i.setProperty({}),this.trackEvent(i,n,r)}},{key:"processIdentify",value:function(e,t,n,r){e&&this.userId&&e!==this.userId&&this.reset(),this.userId=e,this.storage.setUserId(this.userId);var i=(new $n).setType("identify").build();if(t){for(var o in t)this.userTraits[o]=t[o];this.storage.setUserTraits(this.userTraits)}this.identifyUser(i,n,r)}},{key:"identifyUser",value:function(e,t,n){e.message.userId&&(this.userId=e.message.userId,this.storage.setUserId(this.userId)),e&&e.message&&e.message.context&&e.message.context.traits&&(this.userTraits=a({},e.message.context.traits),this.storage.setUserTraits(this.userTraits)),this.processAndSendDataToDestinations("identify",e,t,n)}},{key:"trackPage",value:function(e,t,n){this.processAndSendDataToDestinations("page",e,t,n)}},{key:"trackEvent",value:function(e,t,n){this.processAndSendDataToDestinations("track",e,t,n)}},{key:"processAndSendDataToDestinations",value:function(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),t.message.context.traits=a({},this.userTraits),z.debug("anonymousId: ",this.anonymousId),t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits=a({},this.groupTraits))),this.processOptionsParam(t,n),z.debug(JSON.stringify(t)),Object.keys(t.message.integrations).length>0&&te(t.message.integrations);var i=ne(t.message.integrations,this.clientIntegrationObjects);try{i.forEach((function(n){n.isFailed&&n.isFailed()||n[e]&&n[e](t)}))}catch(e){Q({message:"[sendToNative]:".concat(e)})}this.clientIntegrationObjects||(z.debug("pushing in replay queue"),this.toBeProcessedByIntegrationArray.push([e,t])),o=t.message.integrations,Object.keys(o).forEach((function(e){o.hasOwnProperty(e)&&(V[e]&&(o[V[e]]=o[e]),"All"!=e&&null!=V[e]&&V[e]!=e&&delete o[e])})),jr.call(this,t,e),z.debug("".concat(e," is called ")),r&&r()}catch(e){Q(e)}var o}},{key:"addCampaignInfo",value:function(e){var n=Z().search,r=D(n);e.message.context&&"object"===t(e.message.context)&&(e.message.context.campaign=r)}},{key:"processOptionsParam",value:function(e,n){var r=e.message,i=r.type,s=r.properties;this.addCampaignInfo(e),e.message.context.page="page"==i?this.getContextPageProperties(s):this.getContextPageProperties();var c=["integrations","anonymousId","originalTimestamp"];for(var u in n)c.includes(u)?e.message[u]=n[u]:"context"!==u?e.message.context=v(e.message.context,o({},u,n[u])):"object"===t(n[u])&&null!=n[u]?e.message.context=v(e.message.context,a({},n[u])):z.error("[Analytics: processOptionsParam] context passed in options is not object")}},{key:"getPageProperties",value:function(e,t){var n=Z(),r=t&&t.page?t.page:{};for(var i in n)void 0===e[i]&&(e[i]=r[i]||n[i]);return e}},{key:"getContextPageProperties",value:function(e){var t=Z(),n={};for(var r in t)n[r]=e&&e[r]?e[r]:t[r];return n}},{key:"reset",value:function(){this.loaded&&(this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.storage.clear())}},{key:"getAnonymousId",value:function(){return this.anonymousId=this.storage.getAnonymousId(),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"setAnonymousId",value:function(e){this.anonymousId=e||$(),this.storage.setAnonymousId(this.anonymousId)}},{key:"isValidWriteKey",value:function(e){return!(!e||"string"!=typeof e||0==e.trim().length)}},{key:"isValidServerUrl",value:function(e){return!(!e||"string"!=typeof e||0==e.trim().length)}},{key:"load",value:function(e,n,r){var i=this;if(z.debug("inside load "),!this.loaded){var o=W;if(!this.isValidWriteKey(e)||!this.isValidServerUrl(n))throw Q({message:"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl"}),Error("failed to initialize");if(r&&r.logLevel&&z.setLogLevel(r.logLevel),r&&r.integrations&&(Object.assign(this.loadOnlyIntegrations,r.integrations),te(this.loadOnlyIntegrations)),r&&r.configUrl&&(o=function(e){var t=e;return-1==e.indexOf("sourceConfig")&&(t="/"==t.slice(-1)?t.slice(0,-1):t,t="".concat(t,"/sourceConfig/")),(t="/"==t.slice(-1)?t:"".concat(t,"/")).indexOf("?")>-1?t.split("?")[1]!==W.split("?")[1]&&(t="".concat(t.split("?")[0],"?").concat(W.split("?")[1])):t="".concat(t,"?").concat(W.split("?")[1]),t}(r.configUrl)),r&&r.sendAdblockPage&&(this.sendAdblockPage=!0),r&&r.sendAdblockPageOptions&&"object"===t(r.sendAdblockPageOptions)&&(this.sendAdblockPageOptions=r.sendAdblockPageOptions),r&&r.clientSuppliedCallbacks){var s={};Object.keys(this.methodToCallbackMapping).forEach((function(e){i.methodToCallbackMapping.hasOwnProperty(e)&&r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]]&&(s[e]=r.clientSuppliedCallbacks[i.methodToCallbackMapping[e]])})),Object.assign(this.clientSuppliedCallbacks,s),this.registerCallbacks(!0)}r&&r.queueOptions&&null!=r.queueOptions&&"object"==t(r.queueOptions)?this.eventRepository.startQueue(r.queueOptions):this.eventRepository.startQueue({}),this.eventRepository.writeKey=e,n&&(this.eventRepository.url=n),this.initializeUser(),this.loaded=!0,r&&r.valTrackingList&&r.valTrackingList.push==Array.prototype.push&&(this.trackValues=r.valTrackingList),r&&r.useAutoTracking&&(this.autoTrackFeatureEnabled=!0,this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&(xr(),this.autoTrackHandlersRegistered=!0,z.debug("autoTrackHandlersRegistered",this.autoTrackHandlersRegistered)));try{!function(e,t,n,r){var i=r.bind(e),o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("Authorization","Basic ".concat(btoa("".concat(n,":")))),o.onload=function(){var e=o.status;200==e?(z.debug("status 200 calling callback"),i(200,o.responseText)):(Q(new Error("request failed with status: ".concat(o.status," for url: ").concat(t))),i(e))},o.send()}(this,o,e,this.processResponse)}catch(e){Q(e),this.autoTrackFeatureEnabled&&!this.autoTrackHandlersRegistered&&xr()}}}},{key:"ready",value:function(e){this.loaded&&("function"!=typeof e?z.error("ready callback is not a function"):this.readyCallback=e)}},{key:"initializeCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach((function(t){e.methodToCallbackMapping.hasOwnProperty(t)&&e.on(t,(function(){}))}))}},{key:"registerCallbacks",value:function(e){var t=this;e||Object.keys(this.methodToCallbackMapping).forEach((function(e){t.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[t.methodToCallbackMapping[e]]&&(t.clientSuppliedCallbacks[e]=window.rudderanalytics[t.methodToCallbackMapping[e]])})),Object.keys(this.clientSuppliedCallbacks).forEach((function(e){t.clientSuppliedCallbacks.hasOwnProperty(e)&&(z.debug("registerCallbacks",e,t.clientSuppliedCallbacks[e]),t.on(e,t.clientSuppliedCallbacks[e]))}))}},{key:"sendSampleRequest",value:function(){le("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js")}},{key:"parseQueryString",value:function(e){var t,n,r={},i=y(e),o=(t=i,n={},Object.keys(t).forEach((function(e){e.substr(0,Rr.trait.length)==Rr.trait&&(n[e.substr(Rr.trait.length)]=t[e])})),n),s=function(e){var t={};return Object.keys(e).forEach((function(n){n.substr(0,Rr.prop.length)==Rr.prop&&(t[n.substr(Rr.prop.length)]=e[n])})),t}(i);return i.ajs_uid&&(r.userId=i.ajs_uid,r.traits=o),i.ajs_aid&&(r.anonymousId=i.ajs_aid),i.ajs_event&&(r.event=i.ajs_event,r.properties=s),r}}]),e}());l(Lr),window.addEventListener("error",(function(e){Q(e,Lr)}),!0),Lr.initializeCallbacks(),Lr.registerCallbacks(!1);for(var Ur=!!window.rudderanalytics&&window.rudderanalytics.push==Array.prototype.push,Mr=window.rudderanalytics;Mr&&Mr[0]&&"load"!==Mr[0][0];)Mr.shift();if(Mr&&Mr.length>0&&"load"===Mr[0][0]){var Dr=Mr[0][0];Mr[0].shift(),z.debug("=====from init, calling method:: ",Dr),Lr[Dr].apply(Lr,c(Mr[0])),Mr.shift()}if(function(e,t){t.anonymousId?t.userId?e.unshift(["setAnonymousId",t.anonymousId],["identify",t.userId,t.traits]):e.unshift(["setAnonymousId",t.anonymousId]):t.userId&&e.unshift(["identify",t.userId,t.traits]),t.event&&e.push(["track",t.event,t.properties])}(Mr,Lr.parseQueryString(window.location.search)),Ur&&Mr&&Mr.length>0){for(var Nr=0;Nr\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = merge;\n","'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\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\n/*\n * Module dependencies.\n */\n\nvar each = require('@ndhoule/each');\n\n/**\n * Reduces all the values in a collection down into a single value. Does so by iterating through the\n * collection from left to right, repeatedly calling an `iterator` function and passing to it four\n * arguments: `(accumulator, value, index, collection)`.\n *\n * Returns the final return value of the `iterator` function.\n *\n * @name foldl\n * @api public\n * @param {Function} iterator The function to invoke per iteration.\n * @param {*} accumulator The initial accumulator value, passed to the first invocation of `iterator`.\n * @param {Array|Object} collection The collection to iterate over.\n * @return {*} The return value of the final call to `iterator`.\n * @example\n * foldl(function(total, n) {\n * return total + n;\n * }, 0, [1, 2, 3]);\n * //=> 6\n *\n * var phonebook = { bob: '555-111-2345', tim: '655-222-6789', sheila: '655-333-1298' };\n *\n * foldl(function(results, phoneNumber) {\n * if (phoneNumber[0] === '6') {\n * return results.concat(phoneNumber);\n * }\n * return results;\n * }, [], phonebook);\n * // => ['655-222-6789', '655-333-1298']\n */\nvar foldl = function foldl(iterator, accumulator, collection) {\n if (typeof iterator !== 'function') {\n throw new TypeError('Expected a function but received a ' + typeof iterator);\n }\n\n each(function(val, i, collection) {\n accumulator = iterator(accumulator, val, i, collection);\n }, collection);\n\n return accumulator;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = foldl;\n","'use strict';\n\n/**\n * Module dependencies.\n */\n\nvar foldl = require('@ndhoule/foldl');\nvar parse = require('component-querystring').parse;\n\n/**\n * hasOwnProperty reference.\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Get all utm params from the given `querystring`\n *\n * @param {String} query\n * @return {Object}\n * @api private\n */\n\nfunction utm(query) {\n // Remove leading ? if present\n if (query.charAt(0) === '?') {\n query = query.substring(1);\n }\n\n query = query.replace(/\\?/g, '&');\n\n var param;\n var params = parse(query);\n var results = {};\n\n for (var key in params) {\n if (has.call(params, key)) {\n if (key.substr(0, 4) === 'utm_') {\n param = key.substr(4);\n if (param === 'campaign') param = 'name';\n results[param] = params[key];\n }\n }\n }\n\n return results;\n}\n\nvar allowedKeys = {\n name: true,\n term: true,\n source: true,\n medium: true,\n content: true\n};\n\n/**\n * Get strict utm params - from the given `querystring`\n *\n * @param {String} query\n * @return {Object}\n * @api private\n */\n\nfunction strict(query) {\n return foldl(function(acc, val, key) {\n if (has.call(allowedKeys, key)) acc[key] = val;\n return acc;\n }, {}, utm(query));\n}\n\n/*\n * Exports.\n */\n\nmodule.exports = utm;\nmodule.exports.strict = strict;\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","const LOG_LEVEL_INFO = 1;\nconst LOG_LEVEL_DEBUG = 2;\nconst LOG_LEVEL_WARN = 3;\nconst LOG_LEVEL_ERROR = 4;\nlet LOG_LEVEL = LOG_LEVEL_ERROR;\n\nconst logger = {\n setLogLevel(logLevel) {\n switch (logLevel.toUpperCase()) {\n case \"INFO\":\n LOG_LEVEL = LOG_LEVEL_INFO;\n return;\n case \"DEBUG\":\n LOG_LEVEL = LOG_LEVEL_DEBUG;\n return;\n case \"WARN\":\n LOG_LEVEL = LOG_LEVEL_WARN;\n }\n },\n\n info() {\n if (LOG_LEVEL <= LOG_LEVEL_INFO) {\n console.log(...arguments);\n }\n },\n\n debug() {\n if (LOG_LEVEL <= LOG_LEVEL_DEBUG) {\n console.log(...arguments);\n }\n },\n\n warn() {\n if (LOG_LEVEL <= LOG_LEVEL_WARN) {\n console.log(...arguments);\n }\n },\n\n error() {\n if (LOG_LEVEL <= LOG_LEVEL_ERROR) {\n console.log(...arguments);\n }\n },\n};\nexport default logger;\n","// for sdk side native integration identification\n// add a mapping from common names to index.js exported key names as identified by Rudder\nconst commonNames = {\n All: \"All\",\n \"Google Analytics\": \"GA\",\n GoogleAnalytics: \"GA\",\n GA: \"GA\",\n \"Google Ads\": \"GOOGLEADS\",\n GoogleAds: \"GOOGLEADS\",\n GOOGLEADS: \"GOOGLEADS\",\n Braze: \"BRAZE\",\n BRAZE: \"BRAZE\",\n Chartbeat: \"CHARTBEAT\",\n CHARTBEAT: \"CHARTBEAT\",\n Comscore: \"COMSCORE\",\n COMSCORE: \"COMSCORE\",\n Customerio: \"CUSTOMERIO\",\n \"Customer.io\": \"CUSTOMERIO\",\n \"FB Pixel\": \"FACEBOOK_PIXEL\",\n \"Facebook Pixel\": \"FACEBOOK_PIXEL\",\n FB_PIXEL: \"FACEBOOK_PIXEL\",\n \"Google Tag Manager\": \"GOOGLETAGMANAGER\",\n GTM: \"GTM\",\n Hotjar: \"HOTJAR\",\n hotjar: \"HOTJAR\",\n HOTJAR: \"HOTJAR\",\n Hubspot: \"HS\",\n HUBSPOT: \"HS\",\n Intercom: \"INTERCOM\",\n INTERCOM: \"INTERCOM\",\n Keen: \"KEEN\",\n \"Keen.io\": \"KEEN\",\n KEEN: \"KEEN\",\n Kissmetrics: \"KISSMETRICS\",\n KISSMETRICS: \"KISSMETRICS\",\n Lotame: \"LOTAME\",\n LOTAME: \"LOTAME\",\n \"Visual Website Optimizer\": \"VWO\",\n VWO: \"VWO\",\n OPTIMIZELY: \"OPTIMIZELY\",\n Optimizely: \"OPTIMIZELY\",\n FULLSTORY: \"FULLSTORY\",\n Fullstory: \"FULLSTORY\",\n BUGSNAG: \"BUGSNAG\",\n TVSQUARED: \"TVSQUARED\",\n \"Google Analytics 4\": \"GA4\",\n GoogleAnalytics4: \"GA4\",\n GA4: \"GA4\",\n MOENGAGE: \"MoEngage\",\n AM: \"AM\",\n AMPLITUDE: \"AM\",\n Amplitude: \"AM\",\n Pendo: \"PENDO\",\n PENDO: \"PENDO\",\n Lytics: \"Lytics\",\n LYTICS: \"Lytics\",\n Appcues: \"APPCUES\",\n APPCUES: \"APPCUES\",\n};\n\nexport { commonNames };\n","// from client native integration name to server identified display name\n// add a mapping from Rudder identified key names to Rudder server recognizable names\nconst clientToServerNames = {\n All: \"All\",\n GA: \"Google Analytics\",\n GOOGLEADS: \"Google Ads\",\n BRAZE: \"Braze\",\n CHARTBEAT: \"Chartbeat\",\n COMSCORE: \"Comscore\",\n CUSTOMERIO: \"Customer IO\",\n FACEBOOK_PIXEL: \"Facebook Pixel\",\n GTM: \"Google Tag Manager\",\n HOTJAR: \"Hotjar\",\n HS: \"HubSpot\",\n INTERCOM: \"Intercom\",\n KEEN: \"Keen\",\n KISSMETRICS: \"Kiss Metrics\",\n LOTAME: \"Lotame\",\n VWO: \"VWO\",\n OPTIMIZELY: \"Optimizely\",\n FULLSTORY: \"Fullstory\",\n TVSQUUARED: \"TVSquared\",\n GA4: \"Google Analytics 4\",\n MOENGAGE: \"MoEngage\",\n AM: \"Amplitude\",\n PENDO: \"Pendo\",\n LYTICS: \"Lytics\",\n APPCUES: \"Appcues\",\n};\n\nexport { clientToServerNames };\n","// Message Type enumeration\nconst MessageType = {\n TRACK: \"track\",\n PAGE: \"page\",\n // SCREEN: \"screen\",\n IDENTIFY: \"identify\",\n};\n\n// ECommerce Parameter Names Enumeration\nconst ECommerceParamNames = {\n QUERY: \"query\",\n PRICE: \"price\",\n PRODUCT_ID: \"product_id\",\n CATEGORY: \"category\",\n CURRENCY: \"currency\",\n LIST_ID: \"list_id\",\n PRODUCTS: \"products\",\n WISHLIST_ID: \"wishlist_id\",\n WISHLIST_NAME: \"wishlist_name\",\n QUANTITY: \"quantity\",\n CART_ID: \"cart_id\",\n CHECKOUT_ID: \"checkout_id\",\n TOTAL: \"total\",\n REVENUE: \"revenue\",\n ORDER_ID: \"order_id\",\n FILTERS: \"filters\",\n SORTS: \"sorts\",\n SHARE_VIA: \"share_via\",\n SHARE_MESSAGE: \"share_message\",\n RECIPIENT: \"recipient\",\n};\n// ECommerce Events Enumeration\nconst ECommerceEvents = {\n PRODUCTS_SEARCHED: \"Products Searched\",\n PRODUCT_LIST_VIEWED: \"Product List Viewed\",\n PRODUCT_LIST_FILTERED: \"Product List Filtered\",\n PROMOTION_VIEWED: \"Promotion Viewed\",\n PROMOTION_CLICKED: \"Promotion Clicked\",\n PRODUCT_CLICKED: \"Product Clicked\",\n PRODUCT_VIEWED: \"Product Viewed\",\n PRODUCT_ADDED: \"Product Added\",\n PRODUCT_REMOVED: \"Product Removed\",\n CART_VIEWED: \"Cart Viewed\",\n CHECKOUT_STARTED: \"Checkout Started\",\n CHECKOUT_STEP_VIEWED: \"Checkout Step Viewed\",\n CHECKOUT_STEP_COMPLETED: \"Checkout Step Completed\",\n PAYMENT_INFO_ENTERED: \"Payment Info Entered\",\n ORDER_UPDATED: \"Order Updated\",\n ORDER_COMPLETED: \"Order Completed\",\n ORDER_REFUNDED: \"Order Refunded\",\n ORDER_CANCELLED: \"Order Cancelled\",\n COUPON_ENTERED: \"Coupon Entered\",\n COUPON_APPLIED: \"Coupon Applied\",\n COUPON_DENIED: \"Coupon Denied\",\n COUPON_REMOVED: \"Coupon Removed\",\n PRODUCT_ADDED_TO_WISHLIST: \"Product Added to Wishlist\",\n PRODUCT_REMOVED_FROM_WISHLIST: \"Product Removed from Wishlist\",\n WISH_LIST_PRODUCT_ADDED_TO_CART: \"Wishlist Product Added to Cart\",\n PRODUCT_SHARED: \"Product Shared\",\n CART_SHARED: \"Cart Shared\",\n PRODUCT_REVIEWED: \"Product Reviewed\",\n};\n\n// Enumeration for integrations supported\nconst RudderIntegrationPlatform = {\n RUDDERLABS: \"rudderlabs\",\n GA: \"ga\",\n AMPLITUDE: \"amplitude\",\n};\n\nconst BASE_URL = \"https://hosted.rudderlabs.com\"; // default to RudderStack\nconst CONFIG_URL = \"https://api.rudderlabs.com/sourceConfig/?p=process.module_type&v=process.package_version\";\n\nconst FLUSH_QUEUE_SIZE = 30;\n\nconst FLUSH_INTERVAL_DEFAULT = 5000;\n\nconst MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;\nconst INTEGRATION_LOAD_CHECK_INTERVAL = 1000;\n\nexport {\n MessageType,\n ECommerceParamNames,\n ECommerceEvents,\n RudderIntegrationPlatform,\n BASE_URL,\n CONFIG_URL,\n FLUSH_QUEUE_SIZE,\n FLUSH_INTERVAL_DEFAULT,\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL,\n};\n/* module.exports = {\n MessageType: MessageType,\n ECommerceParamNames: ECommerceParamNames,\n ECommerceEvents: ECommerceEvents,\n RudderIntegrationPlatform: RudderIntegrationPlatform,\n BASE_URL: BASE_URL,\n CONFIG_URL: CONFIG_URL,\n FLUSH_QUEUE_SIZE: FLUSH_QUEUE_SIZE\n}; */\n","// import * as XMLHttpRequestNode from \"Xmlhttprequest\";\nimport { parse } from \"component-url\";\nimport logger from \"./logUtil\";\nimport { commonNames } from \"../integrations/integration_cname\";\nimport { clientToServerNames } from \"../integrations/client_server_name\";\nimport { CONFIG_URL } from \"./constants\";\n\n/**\n *\n * Utility method for excluding null and empty values in JSON\n * @param {*} key\n * @param {*} value\n * @returns\n */\nfunction replacer(key, value) {\n if (value === null || value === undefined) {\n return undefined;\n }\n return value;\n}\n\n/**\n *\n * Utility function for UUID genration\n * @returns\n */\nfunction generateUUID() {\n // Public Domain/MIT\n let d = new Date().getTime();\n if (\n typeof performance !== \"undefined\" &&\n typeof performance.now === \"function\"\n ) {\n d += performance.now(); // use high-precision timer if available\n }\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === \"x\" ? r : (r & 0x3) | 0x8).toString(16);\n });\n}\n\n/**\n *\n * Utility function to get current time (formatted) for including in sent_at field\n * @returns\n */\nfunction getCurrentTimeFormatted() {\n const curDateTime = new Date().toISOString();\n // Keeping same as iso string\n /* let curDate = curDateTime.split(\"T\")[0];\n let curTimeExceptMillis = curDateTime\n .split(\"T\")[1]\n .split(\"Z\")[0]\n .split(\".\")[0];\n let curTimeMillis = curDateTime.split(\"Z\")[0].split(\".\")[1];\n return curDate + \" \" + curTimeExceptMillis + \"+\" + curTimeMillis; */\n return curDateTime;\n}\n\n/**\n *\n * Utility function to retrieve configuration JSON from server\n * @param {*} url\n * @param {*} wrappers\n * @param {*} isLoaded\n * @param {*} callback\n */\nfunction getJSON(url, wrappers, isLoaded, callback) {\n // server-side integration, XHR is node module\n\n const xhr = new XMLHttpRequest();\n\n xhr.open(\"GET\", url, false);\n xhr.onload = function () {\n const { status } = xhr;\n if (status == 200) {\n logger.debug(\"status 200\");\n callback(null, xhr.responseText, wrappers, isLoaded);\n } else {\n callback(status);\n }\n };\n xhr.send();\n}\n\n/**\n *\n * Utility function to retrieve configuration JSON from server\n * @param {*} context\n * @param {*} url\n * @param {*} callback\n */\nfunction getJSONTrimmed(context, url, writeKey, callback) {\n // server-side integration, XHR is node module\n const cb_ = callback.bind(context);\n\n const xhr = new XMLHttpRequest();\n\n xhr.open(\"GET\", url, true);\n xhr.setRequestHeader(\"Authorization\", `Basic ${btoa(`${writeKey}:`)}`);\n\n xhr.onload = function () {\n const { status } = xhr;\n if (status == 200) {\n logger.debug(\"status 200 \" + \"calling callback\");\n cb_(200, xhr.responseText);\n } else {\n handleError(\n new Error(`request failed with status: ${xhr.status} for url: ${url}`)\n );\n cb_(status);\n }\n };\n xhr.send();\n}\n\nfunction handleError(error, analyticsInstance) {\n let errorMessage = error.message ? error.message : undefined;\n let sampleAdBlockTest;\n try {\n if (error instanceof Event) {\n if (error.target && error.target.localName == \"script\") {\n errorMessage = `error in script loading:: src:: ${error.target.src} id:: ${error.target.id}`;\n if (analyticsInstance && error.target.src.includes(\"adsbygoogle\")) {\n sampleAdBlockTest = true;\n analyticsInstance.page(\n \"RudderJS-Initiated\",\n \"ad-block page request\",\n { path: \"/ad-blocked\", title: errorMessage },\n analyticsInstance.sendAdblockPageOptions\n );\n }\n }\n }\n if (errorMessage && !sampleAdBlockTest) {\n logger.error(\"[Util] handleError:: \", errorMessage);\n }\n } catch (e) {\n logger.error(\"[Util] handleError:: \", e);\n }\n}\n\nfunction getDefaultPageProperties() {\n const canonicalUrl = getCanonicalUrl();\n const path = canonicalUrl\n ? parse(canonicalUrl).pathname\n : window.location.pathname;\n const { referrer } = document;\n const { search } = window.location;\n const { title } = document;\n const url = getUrl(search);\n\n return {\n path,\n referrer,\n search,\n title,\n url,\n };\n}\n\nfunction getUrl(search) {\n const canonicalUrl = getCanonicalUrl();\n const url = canonicalUrl\n ? canonicalUrl.indexOf(\"?\") > -1\n ? canonicalUrl\n : canonicalUrl + search\n : window.location.href;\n const hashIndex = url.indexOf(\"#\");\n return hashIndex > -1 ? url.slice(0, hashIndex) : url;\n}\n\nfunction getCanonicalUrl() {\n const tags = document.getElementsByTagName(\"link\");\n for (var i = 0, tag; (tag = tags[i]); i++) {\n if (tag.getAttribute(\"rel\") === \"canonical\") {\n return tag.getAttribute(\"href\");\n }\n }\n}\n\nfunction getCurrency(val) {\n if (!val) return;\n if (typeof val === \"number\") {\n return val;\n }\n if (typeof val !== \"string\") {\n return;\n }\n\n val = val.replace(/\\$/g, \"\");\n val = parseFloat(val);\n\n if (!isNaN(val)) {\n return val;\n }\n}\n\nfunction getRevenue(properties, eventName) {\n let { revenue } = properties;\n const orderCompletedRegExp = /^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;\n\n // it's always revenue, unless it's called during an order completion.\n if (!revenue && eventName && eventName.match(orderCompletedRegExp)) {\n revenue = properties.total;\n }\n\n return getCurrency(revenue);\n}\n\n/**\n *\n *\n * @param {*} integrationObject\n */\nfunction tranformToRudderNames(integrationObject) {\n Object.keys(integrationObject).forEach((key) => {\n if (integrationObject.hasOwnProperty(key)) {\n if (commonNames[key]) {\n integrationObject[commonNames[key]] = integrationObject[key];\n }\n if (key != \"All\") {\n // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys\n if (commonNames[key] != undefined && commonNames[key] != key) {\n delete integrationObject[key];\n }\n }\n }\n });\n}\n\nfunction transformToServerNames(integrationObject) {\n Object.keys(integrationObject).forEach((key) => {\n if (integrationObject.hasOwnProperty(key)) {\n if (clientToServerNames[key]) {\n integrationObject[clientToServerNames[key]] = integrationObject[key];\n }\n if (key != \"All\") {\n // delete user supplied keys except All and if except those where oldkeys are not present or oldkeys are same as transformed keys\n if (\n clientToServerNames[key] != undefined &&\n clientToServerNames[key] != key\n ) {\n delete integrationObject[key];\n }\n }\n }\n });\n}\n\n/**\n *\n * @param {*} sdkSuppliedIntegrations\n * @param {*} configPlaneEnabledIntegrations\n */\nfunction findAllEnabledDestinations(\n sdkSuppliedIntegrations,\n configPlaneEnabledIntegrations\n) {\n const enabledList = [];\n if (\n !configPlaneEnabledIntegrations ||\n configPlaneEnabledIntegrations.length == 0\n ) {\n return enabledList;\n }\n let allValue = true;\n if (typeof configPlaneEnabledIntegrations[0] === \"string\") {\n if (sdkSuppliedIntegrations.All != undefined) {\n allValue = sdkSuppliedIntegrations.All;\n }\n configPlaneEnabledIntegrations.forEach((intg) => {\n if (!allValue) {\n // All false ==> check if intg true supplied\n if (\n sdkSuppliedIntegrations[intg] != undefined &&\n sdkSuppliedIntegrations[intg] == true\n ) {\n enabledList.push(intg);\n }\n } else {\n // All true ==> intg true by default\n let intgValue = true;\n // check if intg false supplied\n if (\n sdkSuppliedIntegrations[intg] != undefined &&\n sdkSuppliedIntegrations[intg] == false\n ) {\n intgValue = false;\n }\n if (intgValue) {\n enabledList.push(intg);\n }\n }\n });\n\n return enabledList;\n }\n\n if (typeof configPlaneEnabledIntegrations[0] === \"object\") {\n if (sdkSuppliedIntegrations.All != undefined) {\n allValue = sdkSuppliedIntegrations.All;\n }\n configPlaneEnabledIntegrations.forEach((intg) => {\n if (!allValue) {\n // All false ==> check if intg true supplied\n if (\n sdkSuppliedIntegrations[intg.name] != undefined &&\n sdkSuppliedIntegrations[intg.name] == true\n ) {\n enabledList.push(intg);\n }\n } else {\n // All true ==> intg true by default\n let intgValue = true;\n // check if intg false supplied\n if (\n sdkSuppliedIntegrations[intg.name] != undefined &&\n sdkSuppliedIntegrations[intg.name] == false\n ) {\n intgValue = false;\n }\n if (intgValue) {\n enabledList.push(intg);\n }\n }\n });\n\n return enabledList;\n }\n}\n\n/**\n * reject all null values from array/object\n * @param {} obj\n * @param {} fn\n */\nfunction rejectArr(obj, fn) {\n fn = fn || compact;\n return type(obj) == \"array\" ? rejectarray(obj, fn) : rejectobject(obj, fn);\n}\n\n/**\n * particular case when rejecting an array\n * @param {} arr\n * @param {} fn\n */\nvar rejectarray = function (arr, fn) {\n const ret = [];\n\n for (let i = 0; i < arr.length; ++i) {\n if (!fn(arr[i], i)) ret[ret.length] = arr[i];\n }\n\n return ret;\n};\n\n/**\n * Rejecting null from any object other than arrays\n * @param {} obj\n * @param {} fn\n *\n */\nvar rejectobject = function (obj, fn) {\n const ret = {};\n\n for (const k in obj) {\n if (obj.hasOwnProperty(k) && !fn(obj[k], k)) {\n ret[k] = obj[k];\n }\n }\n\n return ret;\n};\n\nfunction compact(value) {\n return value == null;\n}\n\n/**\n * check type of object incoming in the rejectArr function\n * @param {} val\n */\nfunction type(val) {\n switch (Object.prototype.toString.call(val)) {\n case \"[object Function]\":\n return \"function\";\n case \"[object Date]\":\n return \"date\";\n case \"[object RegExp]\":\n return \"regexp\";\n case \"[object Arguments]\":\n return \"arguments\";\n case \"[object Array]\":\n return \"array\";\n }\n\n if (val === null) return \"null\";\n if (val === undefined) return \"undefined\";\n if (val === Object(val)) return \"object\";\n\n return typeof val;\n}\n\nfunction getUserProvidedConfigUrl(configUrl) {\n let url = configUrl;\n if (configUrl.indexOf(\"sourceConfig\") == -1) {\n url = url.slice(-1) == \"/\" ? url.slice(0, -1) : url;\n url = `${url}/sourceConfig/`;\n }\n url = url.slice(-1) == \"/\" ? url : `${url}/`;\n if (url.indexOf(\"?\") > -1) {\n if (url.split(\"?\")[1] !== CONFIG_URL.split(\"?\")[1]) {\n url = `${url.split(\"?\")[0]}?${CONFIG_URL.split(\"?\")[1]}`;\n }\n } else {\n url = `${url}?${CONFIG_URL.split(\"?\")[1]}`;\n }\n return url;\n}\n\n/* ------- Start FlattenJson -----------\n * This function flatten given json object to single level.\n * So if there is nested object or array, all will apear in first level properties of an object.\n * Following is case we are handling in this function ::\n * condition 1: String\n * condition 2: Array\n * condition 3: Nested object\n */\nfunction recurse(cur, prop, result) {\n const res = result;\n if (Object(cur) !== cur) {\n res[prop] = cur;\n } else if (Array.isArray(cur)) {\n const l = cur.length;\n for (let i = 0; i < l; i += 1)\n recurse(cur[i], prop ? `${prop}.${i}` : `${i}`, res);\n if (l === 0) res[prop] = [];\n } else {\n let isEmpty = true;\n Object.keys(cur).forEach((key) => {\n isEmpty = false;\n recurse(cur[key], prop ? `${prop}.${key}` : key, res);\n });\n if (isEmpty) res[prop] = {};\n }\n return res;\n}\n\nfunction flattenJsonPayload(data) {\n return recurse(data, \"\", {});\n}\n/* ------- End FlattenJson ----------- */\n\nexport {\n replacer,\n generateUUID,\n getCurrentTimeFormatted,\n getJSONTrimmed,\n getJSON,\n getRevenue,\n getDefaultPageProperties,\n getUserProvidedConfigUrl,\n findAllEnabledDestinations,\n tranformToRudderNames,\n transformToServerNames,\n handleError,\n rejectArr,\n type,\n flattenJsonPayload,\n};\n","import logger from \"../utils/logUtil\";\n\nconst ScriptLoader = (id, src) => {\n logger.debug(`in script loader=== ${id}`);\n const js = document.createElement(\"script\");\n js.src = src;\n js.async = true;\n js.type = \"text/javascript\";\n js.id = id;\n const e = document.getElementsByTagName(\"script\")[0];\n logger.debug(\"==script==\", e);\n e.parentNode.insertBefore(js, e);\n};\n\nexport default ScriptLoader;\n","/* globals window, HTMLElement */\n\n'use strict';\n\n/**!\n * is\n * the definitive JavaScript type testing library\n *\n * @copyright 2013-2014 Enrico Marino / Jordan Harband\n * @license MIT\n */\n\nvar objProto = Object.prototype;\nvar owns = objProto.hasOwnProperty;\nvar toStr = objProto.toString;\nvar symbolValueOf;\nif (typeof Symbol === 'function') {\n symbolValueOf = Symbol.prototype.valueOf;\n}\nvar bigIntValueOf;\nif (typeof BigInt === 'function') {\n bigIntValueOf = BigInt.prototype.valueOf;\n}\nvar isActualNaN = function (value) {\n return value !== value;\n};\nvar NON_HOST_TYPES = {\n 'boolean': 1,\n number: 1,\n string: 1,\n undefined: 1\n};\n\nvar base64Regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{4}|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)$/;\nvar hexRegex = /^[A-Fa-f0-9]+$/;\n\n/**\n * Expose `is`\n */\n\nvar is = {};\n\n/**\n * Test general.\n */\n\n/**\n * is.type\n * Test if `value` is a type of `type`.\n *\n * @param {*} value value to test\n * @param {String} type type\n * @return {Boolean} true if `value` is a type of `type`, false otherwise\n * @api public\n */\n\nis.a = is.type = function (value, type) {\n return typeof value === type;\n};\n\n/**\n * is.defined\n * Test if `value` is defined.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is defined, false otherwise\n * @api public\n */\n\nis.defined = function (value) {\n return typeof value !== 'undefined';\n};\n\n/**\n * is.empty\n * Test if `value` is empty.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is empty, false otherwise\n * @api public\n */\n\nis.empty = function (value) {\n var type = toStr.call(value);\n var key;\n\n if (type === '[object Array]' || type === '[object Arguments]' || type === '[object String]') {\n return value.length === 0;\n }\n\n if (type === '[object Object]') {\n for (key in value) {\n if (owns.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n return !value;\n};\n\n/**\n * is.equal\n * Test if `value` is equal to `other`.\n *\n * @param {*} value value to test\n * @param {*} other value to compare with\n * @return {Boolean} true if `value` is equal to `other`, false otherwise\n */\n\nis.equal = function equal(value, other) {\n if (value === other) {\n return true;\n }\n\n var type = toStr.call(value);\n var key;\n\n if (type !== toStr.call(other)) {\n return false;\n }\n\n if (type === '[object Object]') {\n for (key in value) {\n if (!is.equal(value[key], other[key]) || !(key in other)) {\n return false;\n }\n }\n for (key in other) {\n if (!is.equal(value[key], other[key]) || !(key in value)) {\n return false;\n }\n }\n return true;\n }\n\n if (type === '[object Array]') {\n key = value.length;\n if (key !== other.length) {\n return false;\n }\n while (key--) {\n if (!is.equal(value[key], other[key])) {\n return false;\n }\n }\n return true;\n }\n\n if (type === '[object Function]') {\n return value.prototype === other.prototype;\n }\n\n if (type === '[object Date]') {\n return value.getTime() === other.getTime();\n }\n\n return false;\n};\n\n/**\n * is.hosted\n * Test if `value` is hosted by `host`.\n *\n * @param {*} value to test\n * @param {*} host host to test with\n * @return {Boolean} true if `value` is hosted by `host`, false otherwise\n * @api public\n */\n\nis.hosted = function (value, host) {\n var type = typeof host[value];\n return type === 'object' ? !!host[value] : !NON_HOST_TYPES[type];\n};\n\n/**\n * is.instance\n * Test if `value` is an instance of `constructor`.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an instance of `constructor`\n * @api public\n */\n\nis.instance = is['instanceof'] = function (value, constructor) {\n return value instanceof constructor;\n};\n\n/**\n * is.nil / is.null\n * Test if `value` is null.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is null, false otherwise\n * @api public\n */\n\nis.nil = is['null'] = function (value) {\n return value === null;\n};\n\n/**\n * is.undef / is.undefined\n * Test if `value` is undefined.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is undefined, false otherwise\n * @api public\n */\n\nis.undef = is.undefined = function (value) {\n return typeof value === 'undefined';\n};\n\n/**\n * Test arguments.\n */\n\n/**\n * is.args\n * Test if `value` is an arguments object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an arguments object, false otherwise\n * @api public\n */\n\nis.args = is.arguments = function (value) {\n var isStandardArguments = toStr.call(value) === '[object Arguments]';\n var isOldArguments = !is.array(value) && is.arraylike(value) && is.object(value) && is.fn(value.callee);\n return isStandardArguments || isOldArguments;\n};\n\n/**\n * Test array.\n */\n\n/**\n * is.array\n * Test if 'value' is an array.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an array, false otherwise\n * @api public\n */\n\nis.array = Array.isArray || function (value) {\n return toStr.call(value) === '[object Array]';\n};\n\n/**\n * is.arguments.empty\n * Test if `value` is an empty arguments object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an empty arguments object, false otherwise\n * @api public\n */\nis.args.empty = function (value) {\n return is.args(value) && value.length === 0;\n};\n\n/**\n * is.array.empty\n * Test if `value` is an empty array.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an empty array, false otherwise\n * @api public\n */\nis.array.empty = function (value) {\n return is.array(value) && value.length === 0;\n};\n\n/**\n * is.arraylike\n * Test if `value` is an arraylike object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an arguments object, false otherwise\n * @api public\n */\n\nis.arraylike = function (value) {\n return !!value && !is.bool(value)\n && owns.call(value, 'length')\n && isFinite(value.length)\n && is.number(value.length)\n && value.length >= 0;\n};\n\n/**\n * Test boolean.\n */\n\n/**\n * is.bool\n * Test if `value` is a boolean.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a boolean, false otherwise\n * @api public\n */\n\nis.bool = is['boolean'] = function (value) {\n return toStr.call(value) === '[object Boolean]';\n};\n\n/**\n * is.false\n * Test if `value` is false.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is false, false otherwise\n * @api public\n */\n\nis['false'] = function (value) {\n return is.bool(value) && Boolean(Number(value)) === false;\n};\n\n/**\n * is.true\n * Test if `value` is true.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is true, false otherwise\n * @api public\n */\n\nis['true'] = function (value) {\n return is.bool(value) && Boolean(Number(value)) === true;\n};\n\n/**\n * Test date.\n */\n\n/**\n * is.date\n * Test if `value` is a date.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a date, false otherwise\n * @api public\n */\n\nis.date = function (value) {\n return toStr.call(value) === '[object Date]';\n};\n\n/**\n * is.date.valid\n * Test if `value` is a valid date.\n *\n * @param {*} value value to test\n * @returns {Boolean} true if `value` is a valid date, false otherwise\n */\nis.date.valid = function (value) {\n return is.date(value) && !isNaN(Number(value));\n};\n\n/**\n * Test element.\n */\n\n/**\n * is.element\n * Test if `value` is an html element.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an HTML Element, false otherwise\n * @api public\n */\n\nis.element = function (value) {\n return value !== undefined\n && typeof HTMLElement !== 'undefined'\n && value instanceof HTMLElement\n && value.nodeType === 1;\n};\n\n/**\n * Test error.\n */\n\n/**\n * is.error\n * Test if `value` is an error object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an error object, false otherwise\n * @api public\n */\n\nis.error = function (value) {\n return toStr.call(value) === '[object Error]';\n};\n\n/**\n * Test function.\n */\n\n/**\n * is.fn / is.function (deprecated)\n * Test if `value` is a function.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a function, false otherwise\n * @api public\n */\n\nis.fn = is['function'] = function (value) {\n var isAlert = typeof window !== 'undefined' && value === window.alert;\n if (isAlert) {\n return true;\n }\n var str = toStr.call(value);\n return str === '[object Function]' || str === '[object GeneratorFunction]' || str === '[object AsyncFunction]';\n};\n\n/**\n * Test number.\n */\n\n/**\n * is.number\n * Test if `value` is a number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a number, false otherwise\n * @api public\n */\n\nis.number = function (value) {\n return toStr.call(value) === '[object Number]';\n};\n\n/**\n * is.infinite\n * Test if `value` is positive or negative infinity.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is positive or negative Infinity, false otherwise\n * @api public\n */\nis.infinite = function (value) {\n return value === Infinity || value === -Infinity;\n};\n\n/**\n * is.decimal\n * Test if `value` is a decimal number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a decimal number, false otherwise\n * @api public\n */\n\nis.decimal = function (value) {\n return is.number(value) && !isActualNaN(value) && !is.infinite(value) && value % 1 !== 0;\n};\n\n/**\n * is.divisibleBy\n * Test if `value` is divisible by `n`.\n *\n * @param {Number} value value to test\n * @param {Number} n dividend\n * @return {Boolean} true if `value` is divisible by `n`, false otherwise\n * @api public\n */\n\nis.divisibleBy = function (value, n) {\n var isDividendInfinite = is.infinite(value);\n var isDivisorInfinite = is.infinite(n);\n var isNonZeroNumber = is.number(value) && !isActualNaN(value) && is.number(n) && !isActualNaN(n) && n !== 0;\n return isDividendInfinite || isDivisorInfinite || (isNonZeroNumber && value % n === 0);\n};\n\n/**\n * is.integer\n * Test if `value` is an integer.\n *\n * @param value to test\n * @return {Boolean} true if `value` is an integer, false otherwise\n * @api public\n */\n\nis.integer = is['int'] = function (value) {\n return is.number(value) && !isActualNaN(value) && value % 1 === 0;\n};\n\n/**\n * is.maximum\n * Test if `value` is greater than 'others' values.\n *\n * @param {Number} value value to test\n * @param {Array} others values to compare with\n * @return {Boolean} true if `value` is greater than `others` values\n * @api public\n */\n\nis.maximum = function (value, others) {\n if (isActualNaN(value)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.arraylike(others)) {\n throw new TypeError('second argument must be array-like');\n }\n var len = others.length;\n\n while (--len >= 0) {\n if (value < others[len]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * is.minimum\n * Test if `value` is less than `others` values.\n *\n * @param {Number} value value to test\n * @param {Array} others values to compare with\n * @return {Boolean} true if `value` is less than `others` values\n * @api public\n */\n\nis.minimum = function (value, others) {\n if (isActualNaN(value)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.arraylike(others)) {\n throw new TypeError('second argument must be array-like');\n }\n var len = others.length;\n\n while (--len >= 0) {\n if (value > others[len]) {\n return false;\n }\n }\n\n return true;\n};\n\n/**\n * is.nan\n * Test if `value` is not a number.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is not a number, false otherwise\n * @api public\n */\n\nis.nan = function (value) {\n return !is.number(value) || value !== value;\n};\n\n/**\n * is.even\n * Test if `value` is an even number.\n *\n * @param {Number} value value to test\n * @return {Boolean} true if `value` is an even number, false otherwise\n * @api public\n */\n\nis.even = function (value) {\n return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);\n};\n\n/**\n * is.odd\n * Test if `value` is an odd number.\n *\n * @param {Number} value value to test\n * @return {Boolean} true if `value` is an odd number, false otherwise\n * @api public\n */\n\nis.odd = function (value) {\n return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);\n};\n\n/**\n * is.ge\n * Test if `value` is greater than or equal to `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean}\n * @api public\n */\n\nis.ge = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value >= other;\n};\n\n/**\n * is.gt\n * Test if `value` is greater than `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean}\n * @api public\n */\n\nis.gt = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value > other;\n};\n\n/**\n * is.le\n * Test if `value` is less than or equal to `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean} if 'value' is less than or equal to 'other'\n * @api public\n */\n\nis.le = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value <= other;\n};\n\n/**\n * is.lt\n * Test if `value` is less than `other`.\n *\n * @param {Number} value value to test\n * @param {Number} other value to compare with\n * @return {Boolean} if `value` is less than `other`\n * @api public\n */\n\nis.lt = function (value, other) {\n if (isActualNaN(value) || isActualNaN(other)) {\n throw new TypeError('NaN is not a valid value');\n }\n return !is.infinite(value) && !is.infinite(other) && value < other;\n};\n\n/**\n * is.within\n * Test if `value` is within `start` and `finish`.\n *\n * @param {Number} value value to test\n * @param {Number} start lower bound\n * @param {Number} finish upper bound\n * @return {Boolean} true if 'value' is is within 'start' and 'finish'\n * @api public\n */\nis.within = function (value, start, finish) {\n if (isActualNaN(value) || isActualNaN(start) || isActualNaN(finish)) {\n throw new TypeError('NaN is not a valid value');\n } else if (!is.number(value) || !is.number(start) || !is.number(finish)) {\n throw new TypeError('all arguments must be numbers');\n }\n var isAnyInfinite = is.infinite(value) || is.infinite(start) || is.infinite(finish);\n return isAnyInfinite || (value >= start && value <= finish);\n};\n\n/**\n * Test object.\n */\n\n/**\n * is.object\n * Test if `value` is an object.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is an object, false otherwise\n * @api public\n */\nis.object = function (value) {\n return toStr.call(value) === '[object Object]';\n};\n\n/**\n * is.primitive\n * Test if `value` is a primitive.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a primitive, false otherwise\n * @api public\n */\nis.primitive = function isPrimitive(value) {\n if (!value) {\n return true;\n }\n if (typeof value === 'object' || is.object(value) || is.fn(value) || is.array(value)) {\n return false;\n }\n return true;\n};\n\n/**\n * is.hash\n * Test if `value` is a hash - a plain object literal.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a hash, false otherwise\n * @api public\n */\n\nis.hash = function (value) {\n return is.object(value) && value.constructor === Object && !value.nodeType && !value.setInterval;\n};\n\n/**\n * Test regexp.\n */\n\n/**\n * is.regexp\n * Test if `value` is a regular expression.\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a regexp, false otherwise\n * @api public\n */\n\nis.regexp = function (value) {\n return toStr.call(value) === '[object RegExp]';\n};\n\n/**\n * Test string.\n */\n\n/**\n * is.string\n * Test if `value` is a string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a string, false otherwise\n * @api public\n */\n\nis.string = function (value) {\n return toStr.call(value) === '[object String]';\n};\n\n/**\n * Test base64 string.\n */\n\n/**\n * is.base64\n * Test if `value` is a valid base64 encoded string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a base64 encoded string, false otherwise\n * @api public\n */\n\nis.base64 = function (value) {\n return is.string(value) && (!value.length || base64Regex.test(value));\n};\n\n/**\n * Test base64 string.\n */\n\n/**\n * is.hex\n * Test if `value` is a valid hex encoded string.\n *\n * @param {*} value value to test\n * @return {Boolean} true if 'value' is a hex encoded string, false otherwise\n * @api public\n */\n\nis.hex = function (value) {\n return is.string(value) && (!value.length || hexRegex.test(value));\n};\n\n/**\n * is.symbol\n * Test if `value` is an ES6 Symbol\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a Symbol, false otherise\n * @api public\n */\n\nis.symbol = function (value) {\n return typeof Symbol === 'function' && toStr.call(value) === '[object Symbol]' && typeof symbolValueOf.call(value) === 'symbol';\n};\n\n/**\n * is.bigint\n * Test if `value` is an ES-proposed BigInt\n *\n * @param {*} value value to test\n * @return {Boolean} true if `value` is a BigInt, false otherise\n * @api public\n */\n\nis.bigint = function (value) {\n // eslint-disable-next-line valid-typeof\n return typeof BigInt === 'function' && toStr.call(value) === '[object BigInt]' && typeof bigIntValueOf.call(value) === 'bigint';\n};\n\nmodule.exports = is;\n","import ScriptLoader from \"../ScriptLoader\";\nimport logger from \"../../utils/logUtil\";\n\nclass HubSpot {\n constructor(config) {\n this.hubId = config.hubID; // 6405167\n this.name = \"HS\";\n }\n\n init() {\n const hubspotJs = `https://js.hs-scripts.com/${this.hubId}.js`;\n ScriptLoader(\"hubspot-integration\", hubspotJs);\n\n logger.debug(\"===in init HS===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager identify\");\n\n const { traits } = rudderElement.message.context;\n const traitsValue = {};\n\n for (const k in traits) {\n if (!!Object.getOwnPropertyDescriptor(traits, k) && traits[k]) {\n const hubspotkey = k; // k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n if (Object.prototype.toString.call(traits[k]) == \"[object Date]\") {\n traitsValue[hubspotkey] = traits[k].getTime();\n } else {\n traitsValue[hubspotkey] = traits[k];\n }\n }\n }\n /* if (traitsValue[\"address\"]) {\n let address = traitsValue[\"address\"];\n //traitsValue.delete(address)\n delete traitsValue[\"address\"];\n for (let k in address) {\n if (!!Object.getOwnPropertyDescriptor(address, k) && address[k]) {\n let hubspotkey = k;//k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n hubspotkey = hubspotkey == \"street\" ? \"address\" : hubspotkey;\n traitsValue[hubspotkey] = address[k];\n }\n }\n } */\n const userProperties = rudderElement.message.context.user_properties;\n for (const k in userProperties) {\n if (\n !!Object.getOwnPropertyDescriptor(userProperties, k) &&\n userProperties[k]\n ) {\n const hubspotkey = k; // k.startsWith(\"rl_\") ? k.substring(3, k.length) : k;\n traitsValue[hubspotkey] = userProperties[k];\n }\n }\n\n logger.debug(traitsValue);\n\n if (typeof window !== undefined) {\n const _hsq = (window._hsq = window._hsq || []);\n _hsq.push([\"identify\", traitsValue]);\n }\n }\n\n track(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager track\");\n const _hsq = (window._hsq = window._hsq || []);\n const eventValue = {};\n eventValue.id = rudderElement.message.event;\n if (\n rudderElement.message.properties &&\n (rudderElement.message.properties.revenue ||\n rudderElement.message.properties.value)\n ) {\n eventValue.value =\n rudderElement.message.properties.revenue ||\n rudderElement.message.properties.value;\n }\n _hsq.push([\"trackEvent\", eventValue]);\n }\n\n page(rudderElement) {\n logger.debug(\"in HubspotAnalyticsManager page\");\n const _hsq = (window._hsq = window._hsq || []);\n // logger.debug(\"path: \" + rudderElement.message.properties.path);\n // _hsq.push([\"setPath\", rudderElement.message.properties.path]);\n /* _hsq.push([\"identify\",{\n email: \"testtrackpage@email.com\"\n }]); */\n if (\n rudderElement.message.properties &&\n rudderElement.message.properties.path\n ) {\n _hsq.push([\"setPath\", rudderElement.message.properties.path]);\n }\n _hsq.push([\"trackPageView\"]);\n }\n\n isLoaded() {\n logger.debug(\"in hubspot isLoaded\");\n return !!(window._hsq && window._hsq.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window._hsq && window._hsq.push !== Array.prototype.push);\n }\n}\n\nexport { HubSpot };\n","\n/**\n * Module Dependencies\n */\n\nvar expr;\ntry {\n expr = require('props');\n} catch(e) {\n expr = require('component-props');\n}\n\n/**\n * Expose `toFunction()`.\n */\n\nmodule.exports = toFunction;\n\n/**\n * Convert `obj` to a `Function`.\n *\n * @param {Mixed} obj\n * @return {Function}\n * @api private\n */\n\nfunction toFunction(obj) {\n switch ({}.toString.call(obj)) {\n case '[object Object]':\n return objectToFunction(obj);\n case '[object Function]':\n return obj;\n case '[object String]':\n return stringToFunction(obj);\n case '[object RegExp]':\n return regexpToFunction(obj);\n default:\n return defaultToFunction(obj);\n }\n}\n\n/**\n * Default to strict equality.\n *\n * @param {Mixed} val\n * @return {Function}\n * @api private\n */\n\nfunction defaultToFunction(val) {\n return function(obj){\n return val === obj;\n };\n}\n\n/**\n * Convert `re` to a function.\n *\n * @param {RegExp} re\n * @return {Function}\n * @api private\n */\n\nfunction regexpToFunction(re) {\n return function(obj){\n return re.test(obj);\n };\n}\n\n/**\n * Convert property `str` to a function.\n *\n * @param {String} str\n * @return {Function}\n * @api private\n */\n\nfunction stringToFunction(str) {\n // immediate such as \"> 20\"\n if (/^ *\\W+/.test(str)) return new Function('_', 'return _ ' + str);\n\n // properties such as \"name.first\" or \"age > 18\" or \"age > 18 && age < 36\"\n return new Function('_', 'return ' + get(str));\n}\n\n/**\n * Convert `object` to a function.\n *\n * @param {Object} object\n * @return {Function}\n * @api private\n */\n\nfunction objectToFunction(obj) {\n var match = {};\n for (var key in obj) {\n match[key] = typeof obj[key] === 'string'\n ? defaultToFunction(obj[key])\n : toFunction(obj[key]);\n }\n return function(val){\n if (typeof val !== 'object') return false;\n for (var key in match) {\n if (!(key in val)) return false;\n if (!match[key](val[key])) return false;\n }\n return true;\n };\n}\n\n/**\n * Built the getter function. Supports getter style functions\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction get(str) {\n var props = expr(str);\n if (!props.length) return '_.' + str;\n\n var val, i, prop;\n for (i = 0; i < props.length; i++) {\n prop = props[i];\n val = '_.' + prop;\n val = \"('function' == typeof \" + val + \" ? \" + val + \"() : \" + val + \")\";\n\n // mimic negative lookbehind to avoid problems with nested properties\n str = stripNested(prop, str, val);\n }\n\n return str;\n}\n\n/**\n * Mimic negative lookbehind to avoid problems with nested properties.\n *\n * See: http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript\n *\n * @param {String} prop\n * @param {String} str\n * @param {String} val\n * @return {String}\n * @api private\n */\n\nfunction stripNested (prop, str, val) {\n return str.replace(new RegExp('(\\\\.)?' + prop, 'g'), function($0, $1) {\n return $1 ? $0 : val;\n });\n}\n","\n/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Function]': return 'function';\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object String]': return 'string';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val && val.nodeType === 1) return 'element';\n if (val === Object(val)) return 'object';\n\n return typeof val;\n};\n","/**\n * Global Names\n */\n\nvar globals = /\\b(Array|Date|Object|Math|JSON)\\b/g;\n\n/**\n * Return immediate identifiers parsed from `str`.\n *\n * @param {String} str\n * @param {String|Function} map function or prefix\n * @return {Array}\n * @api public\n */\n\nmodule.exports = function(str, fn){\n var p = unique(props(str));\n if (fn && 'string' == typeof fn) fn = prefixed(fn);\n if (fn) return map(str, p, fn);\n return p;\n};\n\n/**\n * Return immediate identifiers in `str`.\n *\n * @param {String} str\n * @return {Array}\n * @api private\n */\n\nfunction props(str) {\n return str\n .replace(/\\.\\w+|\\w+ *\\(|\"[^\"]*\"|'[^']*'|\\/([^/]+)\\//g, '')\n .replace(globals, '')\n .match(/[a-zA-Z_]\\w*/g)\n || [];\n}\n\n/**\n * Return `str` with `props` mapped with `fn`.\n *\n * @param {String} str\n * @param {Array} props\n * @param {Function} fn\n * @return {String}\n * @api private\n */\n\nfunction map(str, props, fn) {\n var re = /\\.\\w+|\\w+ *\\(|\"[^\"]*\"|'[^']*'|\\/([^/]+)\\/|[a-zA-Z_]\\w*/g;\n return str.replace(re, function(_){\n if ('(' == _[_.length - 1]) return fn(_);\n if (!~props.indexOf(_)) return _;\n return fn(_);\n });\n}\n\n/**\n * Return unique array.\n *\n * @param {Array} arr\n * @return {Array}\n * @api private\n */\n\nfunction unique(arr) {\n var ret = [];\n\n for (var i = 0; i < arr.length; i++) {\n if (~ret.indexOf(arr[i])) continue;\n ret.push(arr[i]);\n }\n\n return ret;\n}\n\n/**\n * Map with prefix `str`.\n */\n\nfunction prefixed(str) {\n return function(_){\n return str + _;\n };\n}\n","\n/**\n * Module dependencies.\n */\n\ntry {\n var type = require('type');\n} catch (err) {\n var type = require('component-type');\n}\n\nvar toFunction = require('to-function');\n\n/**\n * HOP reference.\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Iterate the given `obj` and invoke `fn(val, i)`\n * in optional context `ctx`.\n *\n * @param {String|Array|Object} obj\n * @param {Function} fn\n * @param {Object} [ctx]\n * @api public\n */\n\nmodule.exports = function(obj, fn, ctx){\n fn = toFunction(fn);\n ctx = ctx || this;\n switch (type(obj)) {\n case 'array':\n return array(obj, fn, ctx);\n case 'object':\n if ('number' == typeof obj.length) return array(obj, fn, ctx);\n return object(obj, fn, ctx);\n case 'string':\n return string(obj, fn, ctx);\n }\n};\n\n/**\n * Iterate string chars.\n *\n * @param {String} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction string(obj, fn, ctx) {\n for (var i = 0; i < obj.length; ++i) {\n fn.call(ctx, obj.charAt(i), i);\n }\n}\n\n/**\n * Iterate object keys.\n *\n * @param {Object} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction object(obj, fn, ctx) {\n for (var key in obj) {\n if (has.call(obj, key)) {\n fn.call(ctx, key, obj[key]);\n }\n }\n}\n\n/**\n * Iterate array-ish.\n *\n * @param {Array|Object} obj\n * @param {Function} fn\n * @param {Object} ctx\n * @api private\n */\n\nfunction array(obj, fn, ctx) {\n for (var i = 0; i < obj.length; ++i) {\n fn.call(ctx, obj[i], i);\n }\n}\n","/* eslint-disable class-methods-use-this */\nimport is from \"is\";\nimport each from \"component-each\";\nimport logger from \"../../utils/logUtil\";\nimport { rejectArr } from \"../../utils/utils\";\nimport ScriptLoader from \"../ScriptLoader\";\n\nexport default class GA {\n constructor(config) {\n this.trackingID = config.trackingID;\n this.sendUserId = config.sendUserId || false;\n this.dimensions = config.dimensions || [];\n this.metrics = config.metrics || [];\n this.contentGroupings = config.contentGroupings || [];\n this.nonInteraction = config.nonInteraction || false;\n this.anonymizeIp = config.anonymizeIp || false;\n this.useGoogleAmpClientId = config.useGoogleAmpClientId || false;\n\n this.domain = config.domain || \"auto\";\n this.doubleClick = config.doubleClick || false;\n this.enhancedEcommerce = config.enhancedEcommerce || false;\n this.enhancedLinkAttribution = config.enhancedLinkAttribution || false;\n\n this.includeSearch = config.includeSearch || false;\n this.setAllMappedProps = config.setAllMappedProps || true;\n this.siteSpeedSampleRate = config.siteSpeedSampleRate || 1;\n this.sampleRate = config.sampleRate || 100;\n this.trackCategorizedPages = config.trackCategorizedPages || true;\n this.trackNamedPages = config.trackNamedPages || true;\n this.optimizeContainerId = config.optimize || \"\";\n this.resetCustomDimensionsOnPage = config.resetCustomDimensionsOnPage || [];\n this.enhancedEcommerceLoaded = 0;\n this.namedTracker = config.namedTracker || false;\n this.name = \"GA\";\n this.eventWithCategoryFieldProductScoped = [\n \"product clicked\",\n \"product added\",\n \"product viewed\",\n \"product removed\",\n ];\n }\n\n loadScript() {\n ScriptLoader(\n \"google-analytics\",\n \"https://www.google-analytics.com/analytics.js\"\n );\n }\n\n init() {\n this.pageCalled = false;\n this.dimensionsArray = {};\n let elementTo;\n this.dimensions.forEach((element) => {\n if (element.to.startsWith(\"dimension\")) {\n this.dimensionsArray[element.from] = element.to;\n } else {\n /* eslint-disable no-param-reassign */\n elementTo = element.to.replace(/cd/g, \"dimension\");\n this.dimensionsArray[element.from] = elementTo;\n }\n });\n this.metricsArray = {};\n this.metrics.forEach((element) => {\n if (element.to.startsWith(\"dimension\")) {\n this.metricsArray[element.from] = element.to;\n } else {\n elementTo = element.to.replace(/cm/g, \"metric\");\n this.metricsArray[element.from] = elementTo;\n }\n });\n this.contentGroupingsArray = {};\n this.contentGroupings.forEach((element) => {\n this.contentGroupingsArray[element.from] = element.to;\n });\n window.GoogleAnalyticsObject = \"ga\";\n window.ga =\n window.ga ||\n function a() {\n window.ga.q = window.ga.q || [];\n window.ga.q.push(arguments);\n };\n window.ga.l = new Date().getTime();\n\n this.loadScript();\n\n // create ga with these properties. if the properties are empty it will take default values.\n const config = {\n cookieDomain: this.domain || GA.prototype.defaults.domain,\n siteSpeedSampleRate: this.siteSpeedSampleRate,\n sampleRate: this.sampleRate,\n allowLinker: true,\n useAmpClientId: this.useGoogleAmpClientId,\n };\n\n // set tracker name to rudderGATracker if on\n if (this.namedTracker) {\n config.name = \"rudderGATracker\";\n this.trackerName = \"rudderGATracker.\";\n } else {\n this.trackerName = \"\";\n }\n window.ga(\"create\", this.trackingID, config);\n\n if (this.optimizeContainerId) {\n window.ga(`${this.trackerName}require`, this.optimizeContainerId);\n }\n\n // ecommerce is required\n if (!this.ecommerce) {\n window.ga(`${this.trackerName}require`, \"ecommerce\");\n this.ecommerce = true;\n }\n\n // this is to display advertising\n if (this.doubleClick) {\n window.ga(`${this.trackerName}require`, \"displayfeatures\");\n }\n\n // https://support.google.com/analytics/answer/2558867?hl=en\n if (this.enhancedLinkAttribution) {\n window.ga(`${this.trackerName}require`, \"linkid\");\n }\n\n // a warning is in ga debugger if anonymize is false after initialization\n if (this.anonymizeIp) {\n window.ga(`${this.trackerName}set`, \"anonymizeIp\", true);\n }\n\n logger.debug(\"===in init GA===\");\n }\n\n identify(rudderElement) {\n // send global id\n if (this.sendUserId && rudderElement.message.userId) {\n window.ga(\n `${this.trackerName}set`,\n \"userId\",\n rudderElement.message.userId\n );\n }\n\n // custom dimensions and metrics\n const custom = this.metricsFunction(\n rudderElement.message.context.traits,\n this.dimensionsArray,\n this.metricsArray,\n this.contentGroupingsArray\n );\n\n if (Object.keys(custom).length) {\n window.ga(`${this.trackerName}set`, custom);\n }\n\n logger.debug(\"in GoogleAnalyticsManager identify\");\n }\n\n track(rudderElement) {\n const self = this;\n // Ecommerce events\n const { event, properties, name } = rudderElement.message;\n const options = this.extractCheckoutOptions(rudderElement);\n const props = rudderElement.message.properties;\n const { products } = properties;\n let { total } = properties;\n const data = {};\n const eventCategory = rudderElement.message.properties.category;\n const orderId = properties.order_id;\n const eventAction = event || name || \"\";\n const eventLabel = rudderElement.message.properties.label;\n let eventValue = \"\";\n let payload;\n const { campaign } = rudderElement.message.context;\n let params;\n let filters;\n let sorts;\n if (event === \"Order Completed\" && !this.enhancedEcommerce) {\n // order_id is required\n if (!orderId) {\n logger.debug(\"order_id not present events are not sent to GA\");\n return;\n }\n\n // add transaction\n window.ga(`${this.trackerName}ecommerce:addTransaction`, {\n affiliation: properties.affiliation,\n shipping: properties.shipping,\n revenue: total,\n tax: properties.tax,\n id: orderId,\n currency: properties.currency,\n });\n\n // products added\n products.forEach((product) => {\n const productTrack = self.createProductTrack(rudderElement, product);\n\n window.ga(`${this.trackerName}ecommerce:addItem`, {\n category: productTrack.properties.category,\n quantity: productTrack.properties.quantity,\n price: productTrack.properties.price,\n name: productTrack.properties.name,\n sku: productTrack.properties.sku,\n id: orderId,\n currency: productTrack.properties.currency,\n });\n });\n\n window.ga(`${this.trackerName}ecommerce:send`);\n }\n\n // enhanced ecommerce events\n else if (this.enhancedEcommerce) {\n switch (event) {\n case \"Checkout Started\":\n case \"Checkout Step Viewed\":\n case \"Order Updated\":\n this.loadEnhancedEcommerce(rudderElement);\n each(products, (product) => {\n let productTrack = self.createProductTrack(rudderElement, product);\n productTrack = { message: productTrack };\n\n self.enhancedEcommerceTrackProduct(productTrack);\n });\n\n window.ga(`${this.trackerName}ec:setAction`, \"checkout\", {\n step: properties.step || 1,\n option: options || undefined,\n });\n\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Checkout Step Completed\":\n if (!props.step) {\n logger.debug(\"step not present events are not sent to GA\");\n return;\n }\n params = {\n step: props.step || 1,\n option: options || undefined,\n };\n\n this.loadEnhancedEcommerce(rudderElement);\n\n window.ga(\n `${this.trackerName}ec:setAction`,\n \"checkout_option\",\n params\n );\n window.ga(`${this.trackerName}send`, \"event\", \"Checkout\", \"Option\");\n break;\n case \"Order Completed\":\n total =\n rudderElement.message.properties.total ||\n rudderElement.message.properties.revenue ||\n 0;\n\n if (!orderId) {\n logger.debug(\"order_id not present events are not sent to GA\");\n return;\n }\n this.loadEnhancedEcommerce(rudderElement);\n\n each(products, (product) => {\n let productTrack = self.createProductTrack(rudderElement, product);\n productTrack = { message: productTrack };\n self.enhancedEcommerceTrackProduct(productTrack);\n });\n window.ga(`${this.trackerName}ec:setAction`, \"purchase\", {\n id: orderId,\n affiliation: props.affiliation,\n revenue: total,\n tax: props.tax,\n shipping: props.shipping,\n coupon: props.coupon,\n });\n\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Order Refunded\":\n if (!orderId) {\n logger.debug(\"order_id not present events are not sent to GA\");\n return;\n }\n this.loadEnhancedEcommerce(rudderElement);\n\n each(products, (product) => {\n const track = { properties: product };\n window.ga(`${this.trackerName}ec:addProduct`, {\n id:\n track.properties.product_id ||\n track.properties.id ||\n track.properties.sku,\n quantity: track.properties.quantity,\n });\n });\n\n window.ga(`${this.trackerName}ec:setAction`, \"refund\", {\n id: orderId,\n });\n\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product Added\":\n this.loadEnhancedEcommerce(rudderElement);\n this.enhancedEcommerceTrackProductAction(rudderElement, \"add\", null);\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product Removed\":\n this.loadEnhancedEcommerce(rudderElement);\n this.enhancedEcommerceTrackProductAction(\n rudderElement,\n \"remove\",\n null\n );\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product Viewed\":\n this.loadEnhancedEcommerce(rudderElement);\n\n if (props.list) data.list = props.list;\n this.enhancedEcommerceTrackProductAction(\n rudderElement,\n \"detail\",\n data\n );\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product Clicked\":\n this.loadEnhancedEcommerce(rudderElement);\n\n if (props.list) data.list = props.list;\n this.enhancedEcommerceTrackProductAction(\n rudderElement,\n \"click\",\n data\n );\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Promotion Viewed\":\n this.loadEnhancedEcommerce(rudderElement);\n window.ga(`${this.trackerName}ec:addPromo`, {\n id: props.promotion_id || props.id,\n name: props.name,\n creative: props.creative,\n position: props.position,\n });\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Promotion Clicked\":\n this.loadEnhancedEcommerce(rudderElement);\n\n window.ga(`${this.trackerName}ec:addPromo`, {\n id: props.promotion_id || props.id,\n name: props.name,\n creative: props.creative,\n position: props.position,\n });\n window.ga(`${this.trackerName}ec:setAction`, \"promo_click\", {});\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product List Viewed\":\n this.loadEnhancedEcommerce(rudderElement);\n\n each(products, (product) => {\n const item = { properties: product };\n if (\n !(item.properties.product_id || item.properties.sku) &&\n !item.properties.name\n ) {\n logger.debug(\n \"product_id/sku/name of product not present events are not sent to GA\"\n );\n return;\n }\n let impressionObj = {\n id: item.properties.product_id || item.properties.sku,\n name: item.properties.name,\n category: item.properties.category || props.category,\n list: props.list_id || props.category || \"products\",\n brand: item.properties.band,\n variant: item.properties.variant,\n price: item.properties.price,\n position: self.getProductPosition(item, products),\n };\n impressionObj = {\n ...impressionObj,\n ...self.metricsFunction(\n item.properties,\n self.dimensionsArray,\n self.metricsArray,\n self.contentGroupingsArray\n ),\n };\n Object.keys(impressionObj).forEach((key) => {\n if (impressionObj[key] === undefined) delete impressionObj[key];\n });\n window.ga(`${this.trackerName}ec:addImpression`, impressionObj);\n });\n this.pushEnhancedEcommerce(rudderElement);\n break;\n case \"Product List Filtered\":\n props.filters = props.filters || [];\n props.sorts = props.sorts || [];\n filters = props.filters\n .map((obj) => {\n return `${obj.type}:${obj.value}`;\n })\n .join();\n sorts = props.sorters\n .map((obj) => {\n return `${obj.type}:${obj.value}`;\n })\n .join();\n\n this.loadEnhancedEcommerce(rudderElement);\n\n each(products, (product) => {\n const item = { properties: product };\n\n if (\n !(item.properties.product_id || item.properties.sku) &&\n !item.properties.name\n ) {\n logger.debug(\n \"product_id/sku/name of product not present events are not sent to GA\"\n );\n return;\n }\n\n let impressionObj = {\n id: item.properties.product_id || item.sku,\n name: item.name,\n category: item.category || props.category,\n list: props.list_id || props.category || \"search results\",\n brand: props.brand,\n variant: `${filters}::${sorts}`,\n price: item.price,\n position: self.getProductPosition(item, products),\n };\n\n impressionObj = {\n impressionObj,\n ...self.metricsFunction(\n item.properties,\n self.dimensionsArray,\n self.metricsArray,\n self.contentGroupingsArray\n ),\n };\n Object.keys(impressionObj).forEach((key) => {\n if (impressionObj[key] === undefined) delete impressionObj[key];\n });\n window.ga(`${this.trackerName}ec:addImpression`, impressionObj);\n });\n this.pushEnhancedEcommerce(rudderElement);\n break;\n default:\n if (rudderElement.message.properties) {\n eventValue = rudderElement.message.properties.value\n ? rudderElement.message.properties.value\n : rudderElement.message.properties.revenue;\n }\n\n payload = {\n eventCategory: eventCategory || \"All\",\n eventAction,\n eventLabel,\n eventValue: this.formatValue(eventValue),\n // Allow users to override their nonInteraction integration setting for any single particluar event.\n nonInteraction:\n rudderElement.message.properties.nonInteraction !== undefined\n ? !!rudderElement.message.properties.nonInteraction\n : !!this.nonInteraction,\n };\n\n if (campaign) {\n if (campaign.name) payload.campaignName = campaign.name;\n if (campaign.source) payload.campaignSource = campaign.source;\n if (campaign.medium) payload.campaignMedium = campaign.medium;\n if (campaign.content) payload.campaignContent = campaign.content;\n if (campaign.term) payload.campaignKeyword = campaign.term;\n }\n\n payload = {\n payload,\n ...this.setCustomDimenionsAndMetrics(\n rudderElement.message.properties\n ),\n };\n\n window.ga(`${this.trackerName}send`, \"event\", payload.payload);\n logger.debug(\"in GoogleAnalyticsManager track\");\n }\n } else {\n if (rudderElement.message.properties) {\n eventValue = rudderElement.message.properties.value\n ? rudderElement.message.properties.value\n : rudderElement.message.properties.revenue;\n }\n\n payload = {\n eventCategory: eventCategory || \"All\",\n eventAction,\n eventLabel,\n eventValue: this.formatValue(eventValue),\n // Allow users to override their nonInteraction integration setting for any single particluar event.\n nonInteraction:\n rudderElement.message.properties.nonInteraction !== undefined\n ? !!rudderElement.message.properties.nonInteraction\n : !!this.nonInteraction,\n };\n\n if (campaign) {\n if (campaign.name) payload.campaignName = campaign.name;\n if (campaign.source) payload.campaignSource = campaign.source;\n if (campaign.medium) payload.campaignMedium = campaign.medium;\n if (campaign.content) payload.campaignContent = campaign.content;\n if (campaign.term) payload.campaignKeyword = campaign.term;\n }\n\n payload = {\n payload,\n ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties),\n };\n\n window.ga(`${this.trackerName}send`, \"event\", payload.payload);\n logger.debug(\"in GoogleAnalyticsManager track\");\n }\n }\n\n page(rudderElement) {\n logger.debug(\"in GoogleAnalyticsManager page\");\n\n const { category } = rudderElement.message.properties;\n const eventProperties = rudderElement.message.properties;\n let name;\n if (\n rudderElement.message.properties.category &&\n rudderElement.message.name\n ) {\n name = `${rudderElement.message.properties.category} ${rudderElement.message.name}`;\n } else if (\n !rudderElement.message.properties.category &&\n !rudderElement.message.name\n ) {\n name = \"\";\n } else {\n name =\n rudderElement.message.name || rudderElement.message.properties.category;\n }\n\n const campaign = rudderElement.message.context.campaign || {};\n let pageview = {};\n const pagePath = this.path(eventProperties, this.includeSearch);\n const pageReferrer = rudderElement.message.properties.referrer || \"\";\n let pageTitle;\n if (\n !rudderElement.message.properties.category &&\n !rudderElement.message.name\n )\n pageTitle = eventProperties.title;\n else if (!rudderElement.message.properties.category)\n pageTitle = rudderElement.message.name;\n else if (!rudderElement.message.name)\n pageTitle = rudderElement.message.properties.category;\n else pageTitle = name;\n\n pageview.page = pagePath;\n pageview.title = pageTitle;\n pageview.location = eventProperties.url;\n\n if (campaign) {\n if (campaign.name) pageview.campaignName = campaign.name;\n if (campaign.source) pageview.campaignSource = campaign.source;\n if (campaign.medium) pageview.campaignMedium = campaign.medium;\n if (campaign.content) pageview.campaignContent = campaign.content;\n if (campaign.term) pageview.campaignKeyword = campaign.term;\n }\n\n const resetCustomDimensions = {};\n for (let i = 0; i < this.resetCustomDimensionsOnPage.length; i += 1) {\n const property = this.resetCustomDimensionsOnPage[i]\n .resetCustomDimensionsOnPage;\n if (this.dimensionsArray[property]) {\n resetCustomDimensions[this.dimensionsArray[property]] = null;\n }\n }\n window.ga(`${this.trackerName}set`, resetCustomDimensions);\n\n // adds more properties to pageview which will be sent\n pageview = {\n ...pageview,\n ...this.setCustomDimenionsAndMetrics(eventProperties),\n };\n const payload = {\n page: pagePath,\n title: pageTitle,\n };\n logger.debug(pageReferrer);\n logger.debug(document.referrer);\n if (pageReferrer !== document.referrer) payload.referrer = pageReferrer;\n\n window.ga(`${this.trackerName}set`, payload);\n\n if (this.pageCalled) delete pageview.location;\n\n window.ga(`${this.trackerName}send`, \"pageview\", pageview);\n\n // categorized pages\n if (category && this.trackCategorizedPages) {\n this.track(rudderElement, { nonInteraction: 1 });\n }\n\n // named pages\n if (name && this.trackNamedPages) {\n this.track(rudderElement, { nonInteraction: 1 });\n }\n this.pageCalled = true;\n }\n\n isLoaded() {\n logger.debug(\"in GA isLoaded\");\n return !!window.gaplugins;\n }\n\n isReady() {\n return !!window.gaplugins;\n }\n\n /**\n *\n *\n * @param {} obj incoming properties\n * @param {} dimensions the dimension mapping which is entered by the user in the ui. Eg: firstName : dimension1\n * @param {} metrics the metrics mapping which is entered by the user in the ui. Eg: age : metrics1\n * @param {} contentGroupings the contentGrouping mapping which is entered by the user in the ui. Eg: section : contentGrouping1\n *\n * This function maps these dimensions,metrics and contentGroupings with the incoming properties to send it to GA where the user has to set the corresponding dimension/metric/content group.\n * For example if:\n * if obj -> {age: 24}\n * metrics -> {age: metric1}\n * then the function will return {metric1:24} and it will be shown sent to GA if metric1 is set there.\n *\n * if obj -> {age: 24}\n * metrics - {revenue: metric2}\n * then the function will return {} as there is no corresponding mapping of metric.\n *\n */\n metricsFunction(obj, dimensions, metrics, contentGroupings) {\n const ret = {};\n\n each([metrics, dimensions, contentGroupings], (group) => {\n each(group, (prop, key) => {\n let value = obj[prop];\n if (is.boolean(value)) value = value.toString();\n if (value || value === 0) ret[key] = value;\n });\n });\n\n return ret;\n }\n\n formatValue(value) {\n if (!value || value < 0) return 0;\n return Math.round(value);\n }\n\n /**\n * @param {} props\n * @param {} inputs\n */\n setCustomDimenionsAndMetrics(props) {\n const ret = {};\n const custom = this.metricsFunction(\n props,\n this.dimensionsArray,\n this.metricsArray,\n this.contentGroupingsArray\n );\n if (Object.keys(custom).length) {\n if (this.setAllMappedProps) {\n window.ga(`${this.trackerName}set`, custom);\n } else {\n Object.keys(custom).forEach((key) => {\n ret[key] = custom[key];\n });\n // each(custom, (key, value) => {\n // ret[key] = value;\n // });\n }\n }\n return ret;\n }\n\n /**\n * Return the path based on `properties` and `options`\n *\n * @param {} properties\n * @param {} includeSearch\n */\n path(properties, includeSearch) {\n let str = properties.path;\n if (properties) {\n if (includeSearch && properties.search) {\n str += properties.search;\n }\n }\n return str;\n }\n\n /**\n * Creates a track out of product properties\n * @param {} rudderElement\n * @param {} properties\n */\n createProductTrack(rudderElement, properties) {\n const props = properties || {};\n props.currency =\n properties.currency || rudderElement.message.properties.currency;\n return { properties: props };\n }\n\n /**\n * Loads ec.js (unless already loaded)\n * @param {} rudderElement\n * @param {} a\n */\n loadEnhancedEcommerce(rudderElement) {\n if (this.enhancedEcommerceLoaded === 0) {\n window.ga(`${this.trackerName}require`, \"ec\");\n this.enhancedEcommerceLoaded = 1;\n }\n\n window.ga(\n `${this.trackerName}set`,\n \"&cu\",\n rudderElement.message.properties.currency\n );\n }\n\n /**\n * helper class to not repeat `ec:addProduct`\n * @param {} rudderElement\n * @param {} inputs\n */\n enhancedEcommerceTrackProduct(rudderElement) {\n const props = rudderElement.message.properties;\n\n let product = {\n id: props.product_id || props.id || props.sku,\n name: props.name,\n category: props.category,\n quantity: props.quantity,\n price: props.price,\n brand: props.brand,\n variant: props.variant,\n currency: props.currency,\n };\n\n if (props.position != null) {\n product.position = Math.round(props.position);\n }\n\n const { coupon } = props;\n if (coupon) product.coupon = coupon;\n product = {\n ...product,\n ...this.metricsFunction(\n props,\n this.dimensionsArray,\n this.metricsArray,\n this.contentGroupingsArray\n ),\n };\n\n window.ga(`${this.trackerName}ec:addProduct`, product);\n }\n\n /**\n * set action with data\n * @param {} rudderElement\n * @param {} action\n * @param {} data\n * @param {} inputs\n */\n enhancedEcommerceTrackProductAction(rudderElement, action, data) {\n this.enhancedEcommerceTrackProduct(rudderElement);\n window.ga(`${this.trackerName}ec:setAction`, action, data || {});\n }\n\n /**\n * @param {} rudderElement\n * @param {} inputs\n */\n pushEnhancedEcommerce(rudderElement) {\n const args = rejectArr([\n \"send\",\n \"event\",\n rudderElement.message.properties.category || \"EnhancedEcommerce\",\n rudderElement.message.event || \"Action not defined\",\n rudderElement.message.properties.label,\n {\n nonInteraction: 1,\n ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties),\n },\n ]);\n\n let { event } = rudderElement.message;\n event = event.toLowerCase();\n\n if (this.eventWithCategoryFieldProductScoped.includes(event)) {\n args[2] = \"EnhancedEcommerce\";\n }\n\n window.ga.call(window, ...args);\n }\n\n /**\n * @param {} item\n * @param {} products\n */\n getProductPosition(item, products) {\n const { position } = item.properties;\n\n if (\n typeof position !== \"undefined\" &&\n !Number.isNaN(Number(position)) &&\n Number(position) > -1\n ) {\n return position;\n }\n\n return (\n products\n .map((x) => {\n return x.product_id;\n })\n .indexOf(item.properties.product_id) + 1\n );\n }\n\n /**\n *extracts checkout options\n * @param {} rudderElement\n */\n extractCheckoutOptions(rudderElement) {\n const options = [\n rudderElement.message.properties.paymentMethod,\n rudderElement.message.properties.shippingMethod,\n ];\n // remove all nulls and join with commas.\n const valid = rejectArr(options);\n return valid.length > 0 ? valid.join(\", \") : null;\n }\n}","import logger from \"../../utils/logUtil\";\n\nclass Hotjar {\n constructor(config) {\n this.siteId = config.siteID; // 1549611\n this.name = \"HOTJAR\";\n this._ready = false;\n }\n\n init() {\n window.hotjarSiteId = this.siteId;\n (function (h, o, t, j, a, r) {\n h.hj =\n h.hj ||\n function () {\n (h.hj.q = h.hj.q || []).push(arguments);\n };\n h._hjSettings = { hjid: h.hotjarSiteId, hjsv: 6 };\n a = o.getElementsByTagName(\"head\")[0];\n r = o.createElement(\"script\");\n r.async = 1;\n r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;\n a.appendChild(r);\n })(window, document, \"https://static.hotjar.com/c/hotjar-\", \".js?sv=\");\n this._ready = true;\n\n logger.debug(\"===in init Hotjar===\");\n }\n\n identify(rudderElement) {\n const userId =\n rudderElement.message.userId || rudderElement.message.anonymousId;\n if (!userId) {\n logger.debug(\"[Hotjar] identify:: user id is required\");\n return;\n }\n\n const { traits } = rudderElement.message.context;\n\n window.hj(\"identify\", rudderElement.message.userId, traits);\n }\n\n track(rudderElement) {\n logger.debug(\"[Hotjar] track:: method not supported\");\n }\n\n page(rudderElement) {\n logger.debug(\"[Hotjar] page:: method not supported\");\n }\n\n isLoaded() {\n return this._ready;\n }\n\n isReady() {\n return this._ready;\n }\n}\n\nexport { Hotjar };\n","import logger from \"../../utils/logUtil\";\n\nclass GoogleAds {\n constructor(config) {\n // this.accountId = config.accountId;//AW-696901813\n this.conversionId = config.conversionID;\n this.pageLoadConversions = config.pageLoadConversions;\n this.clickEventConversions = config.clickEventConversions;\n this.defaultPageConversion = config.defaultPageConversion;\n\n this.name = \"GOOGLEADS\";\n }\n\n init() {\n const sourceUrl = `https://www.googletagmanager.com/gtag/js?id=${this.conversionId}`;\n (function (id, src, document) {\n logger.debug(`in script loader=== ${id}`);\n const js = document.createElement(\"script\");\n js.src = src;\n js.async = 1;\n js.type = \"text/javascript\";\n js.id = id;\n const e = document.getElementsByTagName(\"head\")[0];\n logger.debug(\"==script==\", e);\n e.appendChild(js);\n })(\"googleAds-integration\", sourceUrl, document);\n\n window.dataLayer = window.dataLayer || [];\n window.gtag = function () {\n window.dataLayer.push(arguments);\n };\n window.gtag(\"js\", new Date());\n window.gtag(\"config\", this.conversionId);\n\n logger.debug(\"===in init Google Ads===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"[GoogleAds] identify:: method not supported\");\n }\n\n // https://developers.google.com/gtagjs/reference/event\n track(rudderElement) {\n logger.debug(\"in GoogleAdsAnalyticsManager track\");\n const conversionData = this.getConversionData(\n this.clickEventConversions,\n rudderElement.message.event\n );\n if (conversionData.conversionLabel) {\n const { conversionLabel } = conversionData;\n const { eventName } = conversionData;\n const sendToValue = `${this.conversionId}/${conversionLabel}`;\n const properties = {};\n if (rudderElement.properties) {\n properties.value = rudderElement.properties.revenue;\n properties.currency = rudderElement.properties.currency;\n properties.transaction_id = rudderElement.properties.order_id;\n }\n properties.send_to = sendToValue;\n window.gtag(\"event\", eventName, properties);\n }\n }\n\n page(rudderElement) {\n logger.debug(\"in GoogleAdsAnalyticsManager page\");\n const conversionData = this.getConversionData(\n this.pageLoadConversions,\n rudderElement.message.name\n );\n if (conversionData.conversionLabel) {\n const { conversionLabel } = conversionData;\n const { eventName } = conversionData;\n window.gtag(\"event\", eventName, {\n send_to: `${this.conversionId}/${conversionLabel}`,\n });\n }\n }\n\n getConversionData(eventTypeConversions, eventName) {\n const conversionData = {};\n if (eventTypeConversions) {\n if (eventName) {\n eventTypeConversions.forEach((eventTypeConversion) => {\n if (\n eventTypeConversion.name.toLowerCase() === eventName.toLowerCase()\n ) {\n // rudderElement[\"message\"][\"name\"]\n conversionData.conversionLabel =\n eventTypeConversion.conversionLabel;\n conversionData.eventName = eventTypeConversion.name;\n }\n });\n } else if (this.defaultPageConversion) {\n conversionData.conversionLabel = this.defaultPageConversion;\n conversionData.eventName = \"Viewed a Page\";\n }\n }\n return conversionData;\n }\n\n isLoaded() {\n return window.dataLayer.push !== Array.prototype.push;\n }\n\n isReady() {\n return window.dataLayer.push !== Array.prototype.push;\n }\n}\n\nexport { GoogleAds };\n","import logger from \"../../utils/logUtil\";\n\nclass VWO {\n constructor(config, analytics) {\n this.accountId = config.accountId; // 1549611\n this.settingsTolerance = config.settingsTolerance;\n this.isSPA = config.isSPA;\n this.libraryTolerance = config.libraryTolerance;\n this.useExistingJquery = config.useExistingJquery;\n this.sendExperimentTrack = config.sendExperimentTrack;\n this.sendExperimentIdentify = config.sendExperimentIdentify;\n this.name = \"VWO\";\n this.analytics = analytics;\n logger.debug(\"Config \", config);\n }\n\n init() {\n logger.debug(\"===in init VWO===\");\n const account_id = this.accountId;\n const settings_tolerance = this.settingsTolerance;\n const library_tolerance = this.libraryTolerance;\n const use_existing_jquery = this.useExistingJquery;\n const { isSPA } = this;\n window._vwo_code = (function () {\n let f = false;\n const d = document;\n return {\n use_existing_jquery() {\n return use_existing_jquery;\n },\n library_tolerance() {\n return library_tolerance;\n },\n finish() {\n if (!f) {\n f = true;\n const a = d.getElementById(\"_vis_opt_path_hides\");\n if (a) a.parentNode.removeChild(a);\n }\n },\n finished() {\n return f;\n },\n load(a) {\n const b = d.createElement(\"script\");\n b.src = a;\n b.type = \"text/javascript\";\n b.innerText;\n b.onerror = function () {\n _vwo_code.finish();\n };\n d.getElementsByTagName(\"head\")[0].appendChild(b);\n },\n init() {\n const settings_timer = setTimeout(\n \"_vwo_code.finish()\",\n settings_tolerance\n );\n const a = d.createElement(\"style\");\n const b =\n \"body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}\";\n const h = d.getElementsByTagName(\"head\")[0];\n a.setAttribute(\"id\", \"_vis_opt_path_hides\");\n a.setAttribute(\"type\", \"text/css\");\n if (a.styleSheet) a.styleSheet.cssText = b;\n else a.appendChild(d.createTextNode(b));\n h.appendChild(a);\n this.load(\n `//dev.visualwebsiteoptimizer.com/j.php?a=${account_id}&u=${encodeURIComponent(\n d.URL\n )}&r=${Math.random()}&f=${+isSPA}`\n );\n return settings_timer;\n },\n };\n })();\n window._vwo_settings_timer = window._vwo_code.init();\n\n // Send track or iddentify when\n if (this.sendExperimentTrack || this.experimentViewedIdentify) {\n this.experimentViewed();\n }\n }\n\n experimentViewed() {\n window.VWO = window.VWO || [];\n const self = this;\n window.VWO.push([\n \"onVariationApplied\",\n (data) => {\n if (!data) {\n return;\n }\n logger.debug(\"Variation Applied\");\n const expId = data[1];\n const variationId = data[2];\n logger.debug(\n \"experiment id:\",\n expId,\n \"Variation Name:\",\n _vwo_exp[expId].comb_n[variationId]\n );\n if (\n typeof _vwo_exp[expId].comb_n[variationId] !== \"undefined\" &&\n [\"VISUAL_AB\", \"VISUAL\", \"SPLIT_URL\", \"SURVEY\"].indexOf(\n _vwo_exp[expId].type\n ) > -1\n ) {\n try {\n if (self.sendExperimentTrack) {\n logger.debug(\"Tracking...\");\n this.analytics.track(\"Experiment Viewed\", {\n experimentId: expId,\n variationName: _vwo_exp[expId].comb_n[variationId],\n });\n }\n } catch (error) {\n logger.error(\"[VWO] experimentViewed:: \", error);\n }\n try {\n if (self.sendExperimentIdentify) {\n logger.debug(\"Identifying...\");\n this.analytics.identify({\n [`Experiment: ${expId}`]: _vwo_exp[expId].comb_n[variationId],\n });\n }\n } catch (error) {\n logger.error(\"[VWO] experimentViewed:: \", error);\n }\n }\n },\n ]);\n }\n\n identify(rudderElement) {\n logger.debug(\"method not supported\");\n }\n\n track(rudderElement) {\n const eventName = rudderElement.message.event;\n if (eventName === \"Order Completed\") {\n const total = rudderElement.message.properties\n ? rudderElement.message.properties.total ||\n rudderElement.message.properties.revenue\n : 0;\n logger.debug(\"Revenue\", total);\n window.VWO = window.VWO || [];\n window.VWO.push([\"track.revenueConversion\", total]);\n }\n }\n\n page(rudderElement) {\n logger.debug(\"method not supported\");\n }\n\n isLoaded() {\n return !!window._vwo_code;\n }\n\n isReady() {\n return !!window._vwo_code;\n }\n}\n\nexport { VWO };\n","import logger from \"../../utils/logUtil\";\n\nclass GoogleTagManager {\n constructor(config) {\n this.containerID = config.containerID;\n this.name = \"GOOGLETAGMANAGER\";\n }\n\n init() {\n logger.debug(\"===in init GoogleTagManager===\");\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ \"gtm.start\": new Date().getTime(), event: \"gtm.js\" });\n const f = d.getElementsByTagName(s)[0];\n const j = d.createElement(s);\n const dl = l != \"dataLayer\" ? `&l=${l}` : \"\";\n j.async = true;\n j.src = `https://www.googletagmanager.com/gtm.js?id=${i}${dl}`;\n f.parentNode.insertBefore(j, f);\n })(window, document, \"script\", \"dataLayer\", this.containerID);\n }\n\n identify(rudderElement) {\n logger.debug(\"[GTM] identify:: method not supported\");\n }\n\n track(rudderElement) {\n logger.debug(\"===in track GoogleTagManager===\");\n const rudderMessage = rudderElement.message;\n const props = {\n event: rudderMessage.event,\n userId: rudderMessage.userId,\n anonymousId: rudderMessage.anonymousId,\n ...rudderMessage.properties,\n };\n this.sendToGTMDatalayer(props);\n }\n\n page(rudderElement) {\n logger.debug(\"===in page GoogleTagManager===\");\n const rudderMessage = rudderElement.message;\n const pageName = rudderMessage.name;\n const pageCategory = rudderMessage.properties\n ? rudderMessage.properties.category\n : undefined;\n\n let eventName;\n\n if (pageName) {\n eventName = `Viewed ${pageName} page`;\n }\n\n if (pageCategory && pageName) {\n eventName = `Viewed ${pageCategory} ${pageName} page`;\n }\n if (!eventName) {\n eventName = \"Viewed a Page\";\n }\n const props = {\n event: eventName,\n userId: rudderMessage.userId,\n anonymousId: rudderMessage.anonymousId,\n ...rudderMessage.properties,\n };\n\n this.sendToGTMDatalayer(props);\n }\n\n isLoaded() {\n return !!(\n window.dataLayer && Array.prototype.push !== window.dataLayer.push\n );\n }\n\n sendToGTMDatalayer(props) {\n window.dataLayer.push(props);\n }\n\n isReady() {\n return !!(\n window.dataLayer && Array.prototype.push !== window.dataLayer.push\n );\n }\n}\n\nexport { GoogleTagManager };\n","import logger from \"../../utils/logUtil\";\n\n/*\nE-commerce support required for logPurchase support & other e-commerce events as track with productId changed\n*/\nclass Braze {\n constructor(config, analytics) {\n this.analytics = analytics;\n this.appKey = config.appKey;\n if (!config.appKey) this.appKey = \"\";\n this.endPoint = \"\";\n if (config.dataCenter) {\n const dataCenterArr = config.dataCenter.trim().split(\"-\");\n if (dataCenterArr[0].toLowerCase() === \"eu\") {\n this.endPoint = \"sdk.fra-01.braze.eu\";\n } else {\n this.endPoint = `sdk.iad-${dataCenterArr[1]}.braze.com`;\n }\n }\n\n this.name = \"BRAZE\";\n\n logger.debug(\"Config \", config);\n }\n\n /** https://js.appboycdn.com/web-sdk/latest/doc/ab.User.html#toc4\n */\n\n formatGender(gender) {\n if (!gender) return;\n if (typeof gender !== \"string\") return;\n\n const femaleGenders = [\"woman\", \"female\", \"w\", \"f\"];\n const maleGenders = [\"man\", \"male\", \"m\"];\n const otherGenders = [\"other\", \"o\"];\n\n if (femaleGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.FEMALE;\n if (maleGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.MALE;\n if (otherGenders.indexOf(gender.toLowerCase()) > -1)\n return window.appboy.ab.User.Genders.OTHER;\n }\n\n init() {\n logger.debug(\"===in init Braze===\");\n\n // load appboy\n +(function (a, p, P, b, y) {\n a.appboy = {};\n a.appboyQueue = [];\n for (\n let s = \"initialize destroy getDeviceId toggleAppboyLogging setLogger openSession changeUser requestImmediateDataFlush requestFeedRefresh subscribeToFeedUpdates requestContentCardsRefresh subscribeToContentCardsUpdates logCardImpressions logCardClick logCardDismissal logFeedDisplayed logContentCardsDisplayed logInAppMessageImpression logInAppMessageClick logInAppMessageButtonClick logInAppMessageHtmlClick subscribeToNewInAppMessages subscribeToInAppMessage removeSubscription removeAllSubscriptions logCustomEvent logPurchase isPushSupported isPushBlocked isPushGranted isPushPermissionGranted registerAppboyPushMessages unregisterAppboyPushMessages trackLocation stopWebTracking resumeWebTracking wipeData ab ab.DeviceProperties ab.User ab.User.Genders ab.User.NotificationSubscriptionTypes ab.User.prototype.getUserId ab.User.prototype.setFirstName ab.User.prototype.setLastName ab.User.prototype.setEmail ab.User.prototype.setGender ab.User.prototype.setDateOfBirth ab.User.prototype.setCountry ab.User.prototype.setHomeCity ab.User.prototype.setLanguage ab.User.prototype.setEmailNotificationSubscriptionType ab.User.prototype.setPushNotificationSubscriptionType ab.User.prototype.setPhoneNumber ab.User.prototype.setAvatarImageUrl ab.User.prototype.setLastKnownLocation ab.User.prototype.setUserAttribute ab.User.prototype.setCustomUserAttribute ab.User.prototype.addToCustomAttributeArray ab.User.prototype.removeFromCustomAttributeArray ab.User.prototype.incrementCustomUserAttribute ab.User.prototype.addAlias ab.User.prototype.setCustomLocationAttribute ab.InAppMessage ab.InAppMessage.SlideFrom ab.InAppMessage.ClickAction ab.InAppMessage.DismissType ab.InAppMessage.OpenTarget ab.InAppMessage.ImageStyle ab.InAppMessage.TextAlignment ab.InAppMessage.Orientation ab.InAppMessage.CropType ab.InAppMessage.prototype.subscribeToClickedEvent ab.InAppMessage.prototype.subscribeToDismissedEvent ab.InAppMessage.prototype.removeSubscription ab.InAppMessage.prototype.removeAllSubscriptions ab.InAppMessage.prototype.closeMessage ab.InAppMessage.Button ab.InAppMessage.Button.prototype.subscribeToClickedEvent ab.InAppMessage.Button.prototype.removeSubscription ab.InAppMessage.Button.prototype.removeAllSubscriptions ab.SlideUpMessage ab.ModalMessage ab.FullScreenMessage ab.HtmlMessage ab.ControlMessage ab.Feed ab.Feed.prototype.getUnreadCardCount ab.ContentCards ab.ContentCards.prototype.getUnviewedCardCount ab.Card ab.Card.prototype.dismissCard ab.ClassicCard ab.CaptionedImage ab.Banner ab.ControlCard ab.WindowUtils display display.automaticallyShowNewInAppMessages display.showInAppMessage display.showFeed display.destroyFeed display.toggleFeed display.showContentCards display.hideContentCards display.toggleContentCards sharedLib\".split(\n \" \"\n ),\n i = 0;\n i < s.length;\n i++\n ) {\n for (\n var m = s[i], k = a.appboy, l = m.split(\".\"), j = 0;\n j < l.length - 1;\n j++\n )\n k = k[l[j]];\n k[l[j]] = new Function(\n `return function ${m.replace(\n /\\./g,\n \"_\"\n )}(){window.appboyQueue.push(arguments); return true}`\n )();\n }\n window.appboy.getUser = function () {\n return new window.appboy.ab.User();\n };\n window.appboy.getCachedFeed = function () {\n return new window.appboy.ab.Feed();\n };\n window.appboy.getCachedContentCards = function () {\n return new window.appboy.ab.ContentCards();\n };\n (y = p.createElement(P)).type = \"text/javascript\";\n y.src = \"https://js.appboycdn.com/web-sdk/2.4/appboy.min.js\";\n y.async = 1;\n (b = p.getElementsByTagName(P)[0]).parentNode.insertBefore(y, b);\n })(window, document, \"script\");\n\n window.appboy.initialize(this.appKey, {\n enableLogging: true,\n baseUrl: this.endPoint,\n });\n window.appboy.display.automaticallyShowNewInAppMessages();\n\n const { userId } = this.analytics;\n // send userId if you have it https://js.appboycdn.com/web-sdk/latest/doc/module-appboy.html#.changeUser\n if (userId) appboy.changeUser(userId);\n\n window.appboy.openSession();\n }\n\n handleReservedProperties(props) {\n // remove reserved keys from custom event properties\n // https://www.appboy.com/documentation/Platform_Wide/#reserved-keys\n const reserved = [\n \"time\",\n \"product_id\",\n \"quantity\",\n \"event_name\",\n \"price\",\n \"currency\",\n ];\n\n reserved.forEach((element) => {\n delete props[element];\n });\n return props;\n }\n\n identify(rudderElement) {\n const { userId } = rudderElement.message;\n const { address } = rudderElement.message.context.traits;\n const { avatar } = rudderElement.message.context.traits;\n const { birthday } = rudderElement.message.context.traits;\n const { email } = rudderElement.message.context.traits;\n const { firstname } = rudderElement.message.context.traits;\n const { gender } = rudderElement.message.context.traits;\n const { lastname } = rudderElement.message.context.traits;\n const { phone } = rudderElement.message.context.traits;\n\n // This is a hack to make a deep copy that is not recommended because it will often fail:\n const traits = JSON.parse(\n JSON.stringify(rudderElement.message.context.traits)\n );\n\n window.appboy.changeUser(userId);\n window.appboy.getUser().setAvatarImageUrl(avatar);\n if (email) window.appboy.getUser().setEmail(email);\n if (firstname) window.appboy.getUser().setFirstName(firstname);\n if (gender) window.appboy.getUser().setGender(this.formatGender(gender));\n if (lastname) window.appboy.getUser().setLastName(lastname);\n if (phone) window.appboy.getUser().setPhoneNumber(phone);\n if (address) {\n window.appboy.getUser().setCountry(address.country);\n window.appboy.getUser().setHomeCity(address.city);\n }\n if (birthday) {\n window.appboy\n .getUser()\n .setDateOfBirth(\n birthday.getUTCFullYear(),\n birthday.getUTCMonth() + 1,\n birthday.getUTCDate()\n );\n }\n\n // remove reserved keys https://www.appboy.com/documentation/Platform_Wide/#reserved-keys\n const reserved = [\n \"avatar\",\n \"address\",\n \"birthday\",\n \"email\",\n \"id\",\n \"firstname\",\n \"gender\",\n \"lastname\",\n \"phone\",\n \"facebook\",\n \"twitter\",\n \"first_name\",\n \"last_name\",\n \"dob\",\n \"external_id\",\n \"country\",\n \"home_city\",\n \"bio\",\n \"gender\",\n \"phone\",\n \"email_subscribe\",\n \"push_subscribe\",\n ];\n\n reserved.forEach((element) => {\n delete traits[element];\n });\n\n Object.keys(traits).forEach((key) => {\n window.appboy.getUser().setCustomUserAttribute(key, traits[key]);\n });\n }\n\n handlePurchase(properties, userId) {\n const { products } = properties;\n const currencyCode = properties.currency;\n\n window.appboy.changeUser(userId);\n\n // del used properties\n del(properties, \"products\");\n del(properties, \"currency\");\n\n // we have to make a separate call to appboy for each product\n products.forEach((product) => {\n const productId = product.product_id;\n const { price } = product;\n const { quantity } = product;\n if (quantity && price && productId)\n window.appboy.logPurchase(\n productId,\n price,\n currencyCode,\n quantity,\n properties\n );\n });\n }\n\n track(rudderElement) {\n const { userId } = rudderElement.message;\n const eventName = rudderElement.message.event;\n let { properties } = rudderElement.message;\n\n window.appboy.changeUser(userId);\n\n if (eventName.toLowerCase() === \"order completed\") {\n this.handlePurchase(properties, userId);\n } else {\n properties = this.handleReservedProperties(properties);\n window.appboy.logCustomEvent(eventName, properties);\n }\n }\n\n page(rudderElement) {\n const { userId } = rudderElement.message;\n const eventName = rudderElement.message.name;\n let { properties } = rudderElement.message;\n\n properties = this.handleReservedProperties(properties);\n\n window.appboy.changeUser(userId);\n window.appboy.logCustomEvent(eventName, properties);\n }\n\n isLoaded() {\n return window.appboyQueue === null;\n }\n\n isReady() {\n return window.appboyQueue === null;\n }\n}\n\nexport { Braze };\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","(function(){\r\n var crypt = require('crypt'),\r\n utf8 = require('charenc').utf8,\r\n isBuffer = require('is-buffer'),\r\n bin = require('charenc').bin,\r\n\r\n // The core\r\n md5 = function (message, options) {\r\n // Convert to byte array\r\n if (message.constructor == String)\r\n if (options && options.encoding === 'binary')\r\n message = bin.stringToBytes(message);\r\n else\r\n message = utf8.stringToBytes(message);\r\n else if (isBuffer(message))\r\n message = Array.prototype.slice.call(message, 0);\r\n else if (!Array.isArray(message))\r\n message = message.toString();\r\n // else, assume byte array already\r\n\r\n var m = crypt.bytesToWords(message),\r\n l = message.length * 8,\r\n a = 1732584193,\r\n b = -271733879,\r\n c = -1732584194,\r\n d = 271733878;\r\n\r\n // Swap endian\r\n for (var i = 0; i < m.length; i++) {\r\n m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |\r\n ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;\r\n }\r\n\r\n // Padding\r\n m[l >>> 5] |= 0x80 << (l % 32);\r\n m[(((l + 64) >>> 9) << 4) + 14] = l;\r\n\r\n // Method shortcuts\r\n var FF = md5._ff,\r\n GG = md5._gg,\r\n HH = md5._hh,\r\n II = md5._ii;\r\n\r\n for (var i = 0; i < m.length; i += 16) {\r\n\r\n var aa = a,\r\n bb = b,\r\n cc = c,\r\n dd = d;\r\n\r\n a = FF(a, b, c, d, m[i+ 0], 7, -680876936);\r\n d = FF(d, a, b, c, m[i+ 1], 12, -389564586);\r\n c = FF(c, d, a, b, m[i+ 2], 17, 606105819);\r\n b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);\r\n a = FF(a, b, c, d, m[i+ 4], 7, -176418897);\r\n d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);\r\n c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);\r\n b = FF(b, c, d, a, m[i+ 7], 22, -45705983);\r\n a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);\r\n d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);\r\n c = FF(c, d, a, b, m[i+10], 17, -42063);\r\n b = FF(b, c, d, a, m[i+11], 22, -1990404162);\r\n a = FF(a, b, c, d, m[i+12], 7, 1804603682);\r\n d = FF(d, a, b, c, m[i+13], 12, -40341101);\r\n c = FF(c, d, a, b, m[i+14], 17, -1502002290);\r\n b = FF(b, c, d, a, m[i+15], 22, 1236535329);\r\n\r\n a = GG(a, b, c, d, m[i+ 1], 5, -165796510);\r\n d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);\r\n c = GG(c, d, a, b, m[i+11], 14, 643717713);\r\n b = GG(b, c, d, a, m[i+ 0], 20, -373897302);\r\n a = GG(a, b, c, d, m[i+ 5], 5, -701558691);\r\n d = GG(d, a, b, c, m[i+10], 9, 38016083);\r\n c = GG(c, d, a, b, m[i+15], 14, -660478335);\r\n b = GG(b, c, d, a, m[i+ 4], 20, -405537848);\r\n a = GG(a, b, c, d, m[i+ 9], 5, 568446438);\r\n d = GG(d, a, b, c, m[i+14], 9, -1019803690);\r\n c = GG(c, d, a, b, m[i+ 3], 14, -187363961);\r\n b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);\r\n a = GG(a, b, c, d, m[i+13], 5, -1444681467);\r\n d = GG(d, a, b, c, m[i+ 2], 9, -51403784);\r\n c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);\r\n b = GG(b, c, d, a, m[i+12], 20, -1926607734);\r\n\r\n a = HH(a, b, c, d, m[i+ 5], 4, -378558);\r\n d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);\r\n c = HH(c, d, a, b, m[i+11], 16, 1839030562);\r\n b = HH(b, c, d, a, m[i+14], 23, -35309556);\r\n a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);\r\n d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);\r\n c = HH(c, d, a, b, m[i+ 7], 16, -155497632);\r\n b = HH(b, c, d, a, m[i+10], 23, -1094730640);\r\n a = HH(a, b, c, d, m[i+13], 4, 681279174);\r\n d = HH(d, a, b, c, m[i+ 0], 11, -358537222);\r\n c = HH(c, d, a, b, m[i+ 3], 16, -722521979);\r\n b = HH(b, c, d, a, m[i+ 6], 23, 76029189);\r\n a = HH(a, b, c, d, m[i+ 9], 4, -640364487);\r\n d = HH(d, a, b, c, m[i+12], 11, -421815835);\r\n c = HH(c, d, a, b, m[i+15], 16, 530742520);\r\n b = HH(b, c, d, a, m[i+ 2], 23, -995338651);\r\n\r\n a = II(a, b, c, d, m[i+ 0], 6, -198630844);\r\n d = II(d, a, b, c, m[i+ 7], 10, 1126891415);\r\n c = II(c, d, a, b, m[i+14], 15, -1416354905);\r\n b = II(b, c, d, a, m[i+ 5], 21, -57434055);\r\n a = II(a, b, c, d, m[i+12], 6, 1700485571);\r\n d = II(d, a, b, c, m[i+ 3], 10, -1894986606);\r\n c = II(c, d, a, b, m[i+10], 15, -1051523);\r\n b = II(b, c, d, a, m[i+ 1], 21, -2054922799);\r\n a = II(a, b, c, d, m[i+ 8], 6, 1873313359);\r\n d = II(d, a, b, c, m[i+15], 10, -30611744);\r\n c = II(c, d, a, b, m[i+ 6], 15, -1560198380);\r\n b = II(b, c, d, a, m[i+13], 21, 1309151649);\r\n a = II(a, b, c, d, m[i+ 4], 6, -145523070);\r\n d = II(d, a, b, c, m[i+11], 10, -1120210379);\r\n c = II(c, d, a, b, m[i+ 2], 15, 718787259);\r\n b = II(b, c, d, a, m[i+ 9], 21, -343485551);\r\n\r\n a = (a + aa) >>> 0;\r\n b = (b + bb) >>> 0;\r\n c = (c + cc) >>> 0;\r\n d = (d + dd) >>> 0;\r\n }\r\n\r\n return crypt.endian([a, b, c, d]);\r\n };\r\n\r\n // Auxiliary functions\r\n md5._ff = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & c | ~b & d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._gg = function (a, b, c, d, x, s, t) {\r\n var n = a + (b & d | c & ~d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._hh = function (a, b, c, d, x, s, t) {\r\n var n = a + (b ^ c ^ d) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n md5._ii = function (a, b, c, d, x, s, t) {\r\n var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;\r\n return ((n << s) | (n >>> (32 - s))) + b;\r\n };\r\n\r\n // Package private blocksize\r\n md5._blocksize = 16;\r\n md5._digestsize = 16;\r\n\r\n module.exports = function (message, options) {\r\n if (message === undefined || message === null)\r\n throw new Error('Illegal argument ' + message);\r\n\r\n var digestbytes = crypt.wordsToBytes(md5(message, options));\r\n return options && options.asBytes ? digestbytes :\r\n options && options.asString ? bin.bytesToString(digestbytes) :\r\n crypt.bytesToHex(digestbytes);\r\n };\r\n\r\n})();\r\n","import md5 from \"md5\";\nimport logger from \"../../utils/logUtil\";\n\nclass INTERCOM {\n constructor(config) {\n this.NAME = \"INTERCOM\";\n this.API_KEY = config.apiKey;\n this.APP_ID = config.appId;\n this.MOBILE_APP_ID = config.mobileAppId;\n logger.debug(\"Config \", config);\n }\n\n init() {\n window.intercomSettings = {\n app_id: this.APP_ID,\n };\n\n (function () {\n const w = window;\n const ic = w.Intercom;\n if (typeof ic === \"function\") {\n ic(\"reattach_activator\");\n ic(\"update\", w.intercomSettings);\n } else {\n const d = document;\n var i = function () {\n i.c(arguments);\n };\n i.q = [];\n i.c = function (args) {\n i.q.push(args);\n };\n w.Intercom = i;\n const l = function () {\n const s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src = `https://widget.intercom.io/widget/${window.intercomSettings.app_id}`;\n const x = d.getElementsByTagName(\"script\")[0];\n x.parentNode.insertBefore(s, x);\n };\n if (document.readyState === \"complete\") {\n l();\n window.intercom_code = true;\n } else if (w.attachEvent) {\n w.attachEvent(\"onload\", l);\n window.intercom_code = true;\n } else {\n w.addEventListener(\"load\", l, false);\n window.intercom_code = true;\n }\n }\n })();\n }\n\n page() {\n // Get new messages of the current user\n window.Intercom(\"update\");\n }\n\n identify(rudderElement) {\n const rawPayload = {};\n const { context } = rudderElement.message;\n\n const identityVerificationProps = context.Intercom\n ? context.Intercom\n : null;\n if (identityVerificationProps != null) {\n // user hash\n const userHash = context.Intercom.user_hash\n ? context.Intercom.user_hash\n : null;\n\n if (userHash != null) {\n rawPayload.user_hash = userHash;\n }\n\n // hide default launcher\n const hideDefaultLauncher = context.Intercom.hideDefaultLauncher\n ? context.Intercom.hideDefaultLauncher\n : null;\n\n if (hideDefaultLauncher != null) {\n rawPayload.hide_default_launcher = hideDefaultLauncher;\n }\n }\n\n // map rudderPayload to desired\n Object.keys(context.traits).forEach((field) => {\n if (context.traits.hasOwnProperty(field)) {\n const value = context.traits[field];\n\n if (field === \"company\") {\n const companies = [];\n const company = {};\n // special handling string\n if (typeof context.traits[field] === \"string\") {\n company.company_id = md5(context.traits[field]);\n }\n const companyFields =\n (typeof context.traits[field] === \"object\" &&\n Object.keys(context.traits[field])) ||\n [];\n companyFields.forEach((key) => {\n if (companyFields.hasOwnProperty(key)) {\n if (key != \"id\") {\n company[key] = context.traits[field][key];\n } else {\n company.company_id = context.traits[field][key];\n }\n }\n });\n\n if (\n typeof context.traits[field] === \"object\" &&\n !companyFields.includes(\"id\")\n ) {\n company.company_id = md5(company.name);\n }\n\n companies.push(company);\n rawPayload.companies = companies;\n } else {\n rawPayload[field] = context.traits[field];\n }\n\n switch (field) {\n case \"createdAt\":\n rawPayload.created_at = value;\n break;\n case \"anonymousId\":\n rawPayload.user_id = value;\n break;\n\n default:\n break;\n }\n }\n });\n rawPayload.user_id = rudderElement.message.userId;\n window.Intercom(\"update\", rawPayload);\n }\n\n track(rudderElement) {\n const rawPayload = {};\n const { message } = rudderElement;\n\n const properties = message.properties\n ? Object.keys(message.properties)\n : null;\n properties.forEach((property) => {\n const value = message.properties[property];\n rawPayload[property] = value;\n });\n\n if (message.event) {\n rawPayload.event_name = message.event;\n }\n rawPayload.user_id = message.userId ? message.userId : message.anonymousId;\n rawPayload.created_at = Math.floor(\n new Date(message.originalTimestamp).getTime() / 1000\n );\n window.Intercom(\"trackEvent\", rawPayload.event_name, rawPayload);\n }\n\n isLoaded() {\n return !!window.intercom_code;\n }\n\n isReady() {\n return !!window.intercom_code;\n }\n}\n\nexport { INTERCOM };\n","import logger from \"../../utils/logUtil\";\nimport ScriptLoader from \"../ScriptLoader\";\n\nclass Keen {\n constructor(config) {\n this.projectID = config.projectID;\n this.writeKey = config.writeKey;\n this.ipAddon = config.ipAddon;\n this.uaAddon = config.uaAddon;\n this.urlAddon = config.urlAddon;\n this.referrerAddon = config.referrerAddon;\n this.client = null;\n this.name = \"KEEN\";\n }\n\n init() {\n logger.debug(\"===in init Keen===\");\n ScriptLoader(\n \"keen-integration\",\n \"https://cdn.jsdelivr.net/npm/keen-tracking@4\"\n );\n\n const check = setInterval(checkAndInitKeen.bind(this), 1000);\n function initKeen(object) {\n object.client = new window.KeenTracking({\n projectId: object.projectID,\n writeKey: object.writeKey,\n });\n return object.client;\n }\n function checkAndInitKeen() {\n if (window.KeenTracking !== undefined && window.KeenTracking !== void 0) {\n this.client = initKeen(this);\n clearInterval(check);\n }\n }\n }\n\n identify(rudderElement) {\n logger.debug(\"in Keen identify\");\n const { traits } = rudderElement.message.context;\n const userId = rudderElement.message.userId\n ? rudderElement.message.userId\n : rudderElement.message.anonymousId;\n let properties = rudderElement.message.properties\n ? Object.assign(properties, rudderElement.message.properties)\n : {};\n properties.user = {\n userId,\n traits,\n };\n properties = this.getAddOn(properties);\n this.client.extendEvents(properties);\n }\n\n track(rudderElement) {\n logger.debug(\"in Keen track\");\n\n const { event } = rudderElement.message;\n let { properties } = rudderElement.message;\n properties = this.getAddOn(properties);\n this.client.recordEvent(event, properties);\n }\n\n page(rudderElement) {\n logger.debug(\"in Keen page\");\n const pageName = rudderElement.message.name;\n const pageCategory = rudderElement.message.properties\n ? rudderElement.message.properties.category\n : undefined;\n let name = \"Loaded a Page\";\n if (pageName) {\n name = `Viewed ${pageName} page`;\n }\n if (pageCategory && pageName) {\n name = `Viewed ${pageCategory} ${pageName} page`;\n }\n\n let { properties } = rudderElement.message;\n properties = this.getAddOn(properties);\n this.client.recordEvent(name, properties);\n }\n\n isLoaded() {\n logger.debug(\"in Keen isLoaded\");\n return !!(this.client != null);\n }\n\n isReady() {\n return !!(this.client != null);\n }\n\n getAddOn(properties) {\n const addOns = [];\n if (this.ipAddon) {\n properties.ip_address = \"${keen.ip}\";\n addOns.push({\n name: \"keen:ip_to_geo\",\n input: {\n ip: \"ip_address\",\n },\n output: \"ip_geo_info\",\n });\n }\n if (this.uaAddon) {\n properties.user_agent = \"${keen.user_agent}\";\n addOns.push({\n name: \"keen:ua_parser\",\n input: {\n ua_string: \"user_agent\",\n },\n output: \"parsed_user_agent\",\n });\n }\n if (this.urlAddon) {\n properties.page_url = document.location.href;\n addOns.push({\n name: \"keen:url_parser\",\n input: {\n url: \"page_url\",\n },\n output: \"parsed_page_url\",\n });\n }\n if (this.referrerAddon) {\n properties.page_url = document.location.href;\n properties.referrer_url = document.referrer;\n addOns.push({\n name: \"keen:referrer_parser\",\n input: {\n referrer_url: \"referrer_url\",\n page_url: \"page_url\",\n },\n output: \"referrer_info\",\n });\n }\n properties.keen = {\n addons: addOns,\n };\n return properties;\n }\n}\n\nexport { Keen };\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Copy the properties of one or more `objects` onto a destination object. Input objects are iterated over\n * in left-to-right order, so duplicate properties on later objects will overwrite those from\n * erevious ones. Only enumerable and own properties of the input objects are copied onto the\n * resulting object.\n *\n * @name extend\n * @api public\n * @category Object\n * @param {Object} dest The destination object.\n * @param {...Object} sources The source objects.\n * @return {Object} `dest`, extended with the properties of all `sources`.\n * @example\n * var a = { a: 'a' };\n * var b = { b: 'b' };\n * var c = { c: 'c' };\n *\n * extend(a, b, c);\n * //=> { a: 'a', b: 'b', c: 'c' };\n */\nvar extend = function extend(dest /*, sources */) {\n var sources = Array.prototype.slice.call(arguments, 1);\n\n for (var i = 0; i < sources.length; i += 1) {\n for (var key in sources[i]) {\n if (has.call(sources[i], key)) {\n dest[key] = sources[i][key];\n }\n }\n }\n\n return dest;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = extend;\n","\nvar identity = function(_){ return _; };\n\n\n/**\n * Module exports, export\n */\n\nmodule.exports = multiple(find);\nmodule.exports.find = module.exports;\n\n\n/**\n * Export the replacement function, return the modified object\n */\n\nmodule.exports.replace = function (obj, key, val, options) {\n multiple(replace).call(this, obj, key, val, options);\n return obj;\n};\n\n\n/**\n * Export the delete function, return the modified object\n */\n\nmodule.exports.del = function (obj, key, options) {\n multiple(del).call(this, obj, key, null, options);\n return obj;\n};\n\n\n/**\n * Compose applying the function to a nested key\n */\n\nfunction multiple (fn) {\n return function (obj, path, val, options) {\n normalize = options && isFunction(options.normalizer) ? options.normalizer : defaultNormalize;\n path = normalize(path);\n\n var key;\n var finished = false;\n\n while (!finished) loop();\n\n function loop() {\n for (key in obj) {\n var normalizedKey = normalize(key);\n if (0 === path.indexOf(normalizedKey)) {\n var temp = path.substr(normalizedKey.length);\n if (temp.charAt(0) === '.' || temp.length === 0) {\n path = temp.substr(1);\n var child = obj[key];\n\n // we're at the end and there is nothing.\n if (null == child) {\n finished = true;\n return;\n }\n\n // we're at the end and there is something.\n if (!path.length) {\n finished = true;\n return;\n }\n\n // step into child\n obj = child;\n\n // but we're done here\n return;\n }\n }\n }\n\n key = undefined;\n // if we found no matching properties\n // on the current object, there's no match.\n finished = true;\n }\n\n if (!key) return;\n if (null == obj) return obj;\n\n // the `obj` and `key` is one above the leaf object and key, so\n // start object: { a: { 'b.c': 10 } }\n // end object: { 'b.c': 10 }\n // end key: 'b.c'\n // this way, you can do `obj[key]` and get `10`.\n return fn(obj, key, val);\n };\n}\n\n\n/**\n * Find an object by its key\n *\n * find({ first_name : 'Calvin' }, 'firstName')\n */\n\nfunction find (obj, key) {\n if (obj.hasOwnProperty(key)) return obj[key];\n}\n\n\n/**\n * Delete a value for a given key\n *\n * del({ a : 'b', x : 'y' }, 'X' }) -> { a : 'b' }\n */\n\nfunction del (obj, key) {\n if (obj.hasOwnProperty(key)) delete obj[key];\n return obj;\n}\n\n\n/**\n * Replace an objects existing value with a new one\n *\n * replace({ a : 'b' }, 'a', 'c') -> { a : 'c' }\n */\n\nfunction replace (obj, key, val) {\n if (obj.hasOwnProperty(key)) obj[key] = val;\n return obj;\n}\n\n/**\n * Normalize a `dot.separated.path`.\n *\n * A.HELL(!*&#(!)O_WOR LD.bar => ahelloworldbar\n *\n * @param {String} path\n * @return {String}\n */\n\nfunction defaultNormalize(path) {\n return path.replace(/[^a-zA-Z0-9\\.]+/g, '').toLowerCase();\n}\n\n/**\n * Check if a value is a function.\n *\n * @param {*} val\n * @return {boolean} Returns `true` if `val` is a function, otherwise `false`.\n */\n\nfunction isFunction(val) {\n return typeof val === 'function';\n}\n","import is from \"is\";\nimport extend from \"@ndhoule/extend\";\nimport { del } from \"obj-case\";\nimport each from \"component-each\";\nimport { getRevenue } from \"../../utils/utils\";\nimport logger from \"../../utils/logUtil\";\n\nclass Kissmetrics {\n constructor(config) {\n this.apiKey = config.apiKey;\n this.prefixProperties = config.prefixProperties;\n this.name = \"KISSMETRICS\";\n }\n\n init() {\n logger.debug(\"===in init Kissmetrics===\");\n window._kmq = window._kmq || [];\n\n const _kmk = window._kmk || this.apiKey;\n function _kms(u) {\n setTimeout(function () {\n const d = document;\n const f = d.getElementsByTagName(\"script\")[0];\n const s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src = u;\n f.parentNode.insertBefore(s, f);\n }, 1);\n }\n _kms(\"//i.kissmetrics.com/i.js\");\n _kms(`//scripts.kissmetrics.com/${_kmk}.2.js`);\n\n if (this.isEnvMobile()) {\n window._kmq.push([\"set\", { \"Mobile Session\": \"Yes\" }]);\n }\n }\n\n isEnvMobile() {\n return (\n navigator.userAgent.match(/Android/i) ||\n navigator.userAgent.match(/BlackBerry/i) ||\n navigator.userAgent.match(/IEMobile/i) ||\n navigator.userAgent.match(/Opera Mini/i) ||\n navigator.userAgent.match(/iPad/i) ||\n navigator.userAgent.match(/iPhone|iPod/i)\n );\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n toUnixTimestamp(date) {\n date = new Date(date);\n return Math.floor(date.getTime() / 1000);\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n clean(obj) {\n let ret = {};\n\n for (const k in obj) {\n if (obj.hasOwnProperty(k)) {\n const value = obj[k];\n if (value === null || typeof value === \"undefined\") continue;\n\n // convert date to unix\n if (is.date(value)) {\n ret[k] = this.toUnixTimestamp(value);\n continue;\n }\n\n // leave boolean as is\n if (is.bool(value)) {\n ret[k] = value;\n continue;\n }\n\n // leave numbers as is\n if (is.number(value)) {\n ret[k] = value;\n continue;\n }\n\n // convert non objects to strings\n logger.debug(value.toString());\n if (value.toString() !== \"[object Object]\") {\n ret[k] = value.toString();\n continue;\n }\n\n // json\n // must flatten including the name of the original trait/property\n const nestedObj = {};\n nestedObj[k] = value;\n const flattenedObj = this.flatten(nestedObj, { safe: true });\n\n // stringify arrays inside nested object to be consistent with top level behavior of arrays\n for (const key in flattenedObj) {\n if (is.array(flattenedObj[key])) {\n flattenedObj[key] = flattenedObj[key].toString();\n }\n }\n\n ret = extend(ret, flattenedObj);\n delete ret[k];\n }\n }\n return ret;\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n flatten(target, opts) {\n opts = opts || {};\n\n const delimiter = opts.delimiter || \".\";\n let { maxDepth } = opts;\n let currentDepth = 1;\n const output = {};\n\n function step(object, prev) {\n for (const key in object) {\n if (object.hasOwnProperty(key)) {\n const value = object[key];\n const isarray = opts.safe && is.array(value);\n const type = Object.prototype.toString.call(value);\n const isobject =\n type === \"[object Object]\" || type === \"[object Array]\";\n const arr = [];\n\n const newKey = prev ? prev + delimiter + key : key;\n\n if (!opts.maxDepth) {\n maxDepth = currentDepth + 1;\n }\n\n for (const keys in value) {\n if (value.hasOwnProperty(keys)) {\n arr.push(keys);\n }\n }\n\n if (!isarray && isobject && arr.length && currentDepth < maxDepth) {\n ++currentDepth;\n return step(value, newKey);\n }\n\n output[newKey] = value;\n }\n }\n }\n\n step(target);\n\n return output;\n }\n\n // source : https://github.com/segment-integrations/analytics.js-integration-kissmetrics/blob/master/lib/index.js\n prefix(event, properties) {\n const prefixed = {};\n each(properties, function (key, val) {\n if (key === \"Billing Amount\") {\n prefixed[key] = val;\n } else if (key === \"revenue\") {\n prefixed[`${event} - ${key}`] = val;\n prefixed[\"Billing Amount\"] = val;\n } else {\n prefixed[`${event} - ${key}`] = val;\n }\n });\n return prefixed;\n }\n\n identify(rudderElement) {\n logger.debug(\"in Kissmetrics identify\");\n const traits = this.clean(rudderElement.message.context.traits);\n const userId =\n rudderElement.message.userId && rudderElement.message.userId != \"\"\n ? rudderElement.message.userId\n : undefined;\n\n if (userId) {\n window._kmq.push([\"identify\", userId]);\n }\n if (traits) {\n window._kmq.push([\"set\", traits]);\n }\n }\n\n track(rudderElement) {\n logger.debug(\"in Kissmetrics track\");\n\n const { event } = rudderElement.message;\n let properties = JSON.parse(\n JSON.stringify(rudderElement.message.properties)\n );\n const timestamp = this.toUnixTimestamp(new Date());\n\n const revenue = getRevenue(properties);\n if (revenue) {\n properties.revenue = revenue;\n }\n\n const { products } = properties;\n if (products) {\n delete properties.products;\n }\n\n properties = this.clean(properties);\n logger.debug(JSON.stringify(properties));\n\n if (this.prefixProperties) {\n properties = this.prefix(event, properties);\n }\n window._kmq.push([\"record\", event, properties]);\n\n const iterator = function pushItem(product, i) {\n let item = product;\n if (this.prefixProperties) item = this.prefix(event, item);\n item._t = timestamp + i;\n item._d = 1;\n window.KM.set(item);\n }.bind(this);\n\n if (products) {\n window._kmq.push(() => {\n each(products, iterator);\n });\n }\n }\n\n page(rudderElement) {\n logger.debug(\"in Kissmetrics page\");\n const pageName = rudderElement.message.name;\n const pageCategory = rudderElement.message.properties\n ? rudderElement.message.properties.category\n : undefined;\n let name = \"Loaded a Page\";\n if (pageName) {\n name = `Viewed ${pageName} page`;\n }\n if (pageCategory && pageName) {\n name = `Viewed ${pageCategory} ${pageName} page`;\n }\n\n let { properties } = rudderElement.message;\n if (this.prefixProperties) {\n properties = this.prefix(\"Page\", properties);\n }\n\n window._kmq.push([\"record\", name, properties]);\n }\n\n alias(rudderElement) {\n const prev = rudderElement.message.previousId;\n const { userId } = rudderElement.message;\n window._kmq.push([\"alias\", userId, prev]);\n }\n\n group(rudderElement) {\n const { groupId } = rudderElement.message;\n let groupTraits = rudderElement.message.traits;\n groupTraits = this.prefix(\"Group\", groupTraits);\n if (groupId) {\n groupTraits[\"Group - id\"] = groupId;\n }\n window._kmq.push([\"set\", groupTraits]);\n logger.debug(\"in Kissmetrics group\");\n }\n\n isLoaded() {\n return is.object(window.KM);\n }\n\n isReady() {\n return is.object(window.KM);\n }\n}\n\nexport { Kissmetrics };\n","import logger from \"../../utils/logUtil\";\n\nclass CustomerIO {\n constructor(config) {\n this.siteID = config.siteID;\n this.apiKey = config.apiKey;\n\n this.name = \"CUSTOMERIO\";\n }\n\n init() {\n logger.debug(\"===in init Customer IO init===\");\n window._cio = window._cio || [];\n const { siteID } = this;\n (function () {\n let a;\n let b;\n let c;\n a = function (f) {\n return function () {\n window._cio.push(\n [f].concat(Array.prototype.slice.call(arguments, 0))\n );\n };\n };\n b = [\"load\", \"identify\", \"sidentify\", \"track\", \"page\"];\n for (c = 0; c < b.length; c++) {\n window._cio[b[c]] = a(b[c]);\n }\n const t = document.createElement(\"script\");\n const s = document.getElementsByTagName(\"script\")[0];\n t.async = true;\n t.id = \"cio-tracker\";\n t.setAttribute(\"data-site-id\", siteID);\n t.src = \"https://assets.customer.io/assets/track.js\";\n s.parentNode.insertBefore(t, s);\n })();\n }\n\n identify(rudderElement) {\n logger.debug(\"in Customer IO identify\");\n const userId = rudderElement.message.userId\n ? rudderElement.message.userId\n : rudderElement.message.anonymousId;\n const traits = rudderElement.message.context.traits\n ? rudderElement.message.context.traits\n : {};\n if (!traits.created_at) {\n traits.created_at = Math.floor(new Date().getTime() / 1000);\n }\n traits.id = userId;\n window._cio.identify(traits);\n }\n\n track(rudderElement) {\n logger.debug(\"in Customer IO track\");\n\n const eventName = rudderElement.message.event;\n const { properties } = rudderElement.message;\n window._cio.track(eventName, properties);\n }\n\n page(rudderElement) {\n logger.debug(\"in Customer IO page\");\n\n const name =\n rudderElement.message.name || rudderElement.message.properties.url;\n window._cio.page(name, rudderElement.message.properties);\n }\n\n isLoaded() {\n return !!(window._cio && window._cio.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window._cio && window._cio.push !== Array.prototype.push);\n }\n}\n\nexport { CustomerIO };\n","var each = require('each');\n\n\n/**\n * Cache whether `` exists.\n */\n\nvar body = false;\n\n\n/**\n * Callbacks to call when the body exists.\n */\n\nvar callbacks = [];\n\n\n/**\n * Export a way to add handlers to be invoked once the body exists.\n *\n * @param {Function} callback A function to call when the body exists.\n */\n\nmodule.exports = function onBody (callback) {\n if (body) {\n call(callback);\n } else {\n callbacks.push(callback);\n }\n};\n\n\n/**\n * Set an interval to check for `document.body`.\n */\n\nvar interval = setInterval(function () {\n if (!document.body) return;\n body = true;\n each(callbacks, call);\n clearInterval(interval);\n}, 5);\n\n\n/**\n * Call a callback, passing it the body.\n *\n * @param {Function} callback The callback to call.\n */\n\nfunction call (callback) {\n callback(document.body);\n}","import onBody from \"on-body\";\nimport logger from \"../../utils/logUtil\";\nimport {\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL,\n} from \"../../utils/constants\";\n\nclass Chartbeat {\n constructor(config, analytics) {\n this.analytics = analytics; // use this to modify failed integrations or for passing events from callback to other destinations\n this._sf_async_config = window._sf_async_config =\n window._sf_async_config || {};\n window._sf_async_config.useCanonical = true;\n window._sf_async_config.uid = config.uid;\n window._sf_async_config.domain = config.domain;\n this.isVideo = !!config.video;\n this.sendNameAndCategoryAsTitle = config.sendNameAndCategoryAsTitle || true;\n this.subscriberEngagementKeys = config.subscriberEngagementKeys || [];\n this.replayEvents = [];\n this.failed = false;\n this.isFirstPageCallMade = false;\n this.name = \"CHARTBEAT\";\n }\n\n init() {\n logger.debug(\"===in init Chartbeat===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in Chartbeat identify\");\n }\n\n track(rudderElement) {\n logger.debug(\"in Chartbeat track\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Chartbeat page\");\n this.loadConfig(rudderElement);\n\n if (!this.isFirstPageCallMade) {\n this.isFirstPageCallMade = true;\n this.initAfterPage();\n } else {\n if (this.failed) {\n logger.debug(\"===ignoring cause failed integration===\");\n this.replayEvents = [];\n return;\n }\n if (!this.isLoaded() && !this.failed) {\n logger.debug(\"===pushing to replay queue for chartbeat===\");\n this.replayEvents.push([\"page\", rudderElement]);\n return;\n }\n logger.debug(\"===processing page event in chartbeat===\");\n const { properties } = rudderElement.message;\n window.pSUPERFLY.virtualPage(properties.path);\n }\n }\n\n isLoaded() {\n logger.debug(\"in Chartbeat isLoaded\");\n if (!this.isFirstPageCallMade) {\n return true;\n }\n return !!window.pSUPERFLY;\n }\n\n isFailed() {\n return this.failed;\n }\n\n isReady() {\n return !!window.pSUPERFLY;\n }\n\n loadConfig(rudderElement) {\n const { properties } = rudderElement.message;\n const category = properties ? properties.category : undefined;\n const { name } = rudderElement.message;\n const author = properties ? properties.author : undefined;\n let title;\n if (this.sendNameAndCategoryAsTitle) {\n title = category && name ? `${category} ${name}` : name;\n }\n if (category) window._sf_async_config.sections = category;\n if (author) window._sf_async_config.authors = author;\n if (title) window._sf_async_config.title = title;\n\n const _cbq = (window._cbq = window._cbq || []);\n\n for (const key in properties) {\n if (!properties.hasOwnProperty(key)) continue;\n if (this.subscriberEngagementKeys.indexOf(key) > -1) {\n _cbq.push([key, properties[key]]);\n }\n }\n }\n\n initAfterPage() {\n onBody(() => {\n const script = this.isVideo ? \"chartbeat_video.js\" : \"chartbeat.js\";\n function loadChartbeat() {\n const e = document.createElement(\"script\");\n const n = document.getElementsByTagName(\"script\")[0];\n e.type = \"text/javascript\";\n e.async = true;\n e.src = `//static.chartbeat.com/js/${script}`;\n n.parentNode.insertBefore(e, n);\n }\n loadChartbeat();\n });\n\n this._isReady(this).then((instance) => {\n logger.debug(\"===replaying on chartbeat===\");\n instance.replayEvents.forEach((event) => {\n instance[event[0]](event[1]);\n });\n });\n }\n\n pause(time) {\n return new Promise((resolve) => {\n setTimeout(resolve, time);\n });\n }\n\n _isReady(instance, time = 0) {\n return new Promise((resolve) => {\n if (this.isLoaded()) {\n this.failed = false;\n logger.debug(\"===chartbeat loaded successfully===\");\n instance.analytics.emit(\"ready\");\n return resolve(instance);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n this.failed = true;\n logger.debug(\"===chartbeat failed===\");\n return resolve(instance);\n }\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n return this._isReady(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n}\n\nexport { Chartbeat };\n","import logger from \"../../utils/logUtil\";\nimport {\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL,\n} from \"../../utils/constants\";\n\nclass Comscore {\n constructor(config, analytics) {\n this.c2ID = config.c2ID;\n this.analytics = analytics;\n this.comScoreBeaconParam = config.comScoreBeaconParam\n ? config.comScoreBeaconParam\n : {};\n this.isFirstPageCallMade = false;\n this.failed = false;\n this.comScoreParams = {};\n this.replayEvents = [];\n this.name = \"COMSCORE\";\n }\n\n init() {\n logger.debug(\"===in init Comscore init===\");\n }\n\n identify(rudderElement) {\n logger.debug(\"in Comscore identify\");\n }\n\n track(rudderElement) {\n logger.debug(\"in Comscore track\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Comscore page\");\n\n this.loadConfig(rudderElement);\n\n if (!this.isFirstPageCallMade) {\n this.isFirstPageCallMade = true;\n this.initAfterPage();\n } else {\n if (this.failed) {\n this.replayEvents = [];\n return;\n }\n if (!this.isLoaded() && !this.failed) {\n this.replayEvents.push([\"page\", rudderElement]);\n return;\n }\n const { properties } = rudderElement.message;\n // window.COMSCORE.beacon({c1:\"2\", c2: \"\"});\n // this.comScoreParams = this.mapComscoreParams(properties);\n window.COMSCORE.beacon(this.comScoreParams);\n }\n }\n\n loadConfig(rudderElement) {\n logger.debug(\"=====in loadConfig=====\");\n this.comScoreParams = this.mapComscoreParams(\n rudderElement.message.properties\n );\n window._comscore = window._comscore || [];\n window._comscore.push(this.comScoreParams);\n }\n\n initAfterPage() {\n logger.debug(\"=====in initAfterPage=====\");\n (function () {\n const s = document.createElement(\"script\");\n const el = document.getElementsByTagName(\"script\")[0];\n s.async = true;\n s.src = `${\n document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\"\n }.scorecardresearch.com/beacon.js`;\n el.parentNode.insertBefore(s, el);\n })();\n\n this._isReady(this).then((instance) => {\n instance.replayEvents.forEach((event) => {\n instance[event[0]](event[1]);\n });\n });\n }\n\n pause(time) {\n return new Promise((resolve) => {\n setTimeout(resolve, time);\n });\n }\n\n _isReady(instance, time = 0) {\n return new Promise((resolve) => {\n if (this.isLoaded()) {\n this.failed = false;\n instance.analytics.emit(\"ready\");\n return resolve(instance);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n this.failed = true;\n return resolve(instance);\n }\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n return this._isReady(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n\n mapComscoreParams(properties) {\n logger.debug(\"=====in mapComscoreParams=====\");\n const comScoreBeaconParamsMap = this.comScoreBeaconParam;\n\n const comScoreParams = {};\n\n Object.keys(comScoreBeaconParamsMap).forEach(function (property) {\n if (property in properties) {\n const key = comScoreBeaconParamsMap[property];\n const value = properties[property];\n comScoreParams[key] = value;\n }\n });\n\n comScoreParams.c1 = \"2\";\n comScoreParams.c2 = this.c2ID;\n /* if (this.options.comscorekw.length) {\n comScoreParams.comscorekw = this.options.comscorekw;\n } */\n logger.debug(\"=====in mapComscoreParams=====\", comScoreParams);\n return comScoreParams;\n }\n\n isLoaded() {\n logger.debug(\"in Comscore isLoaded\");\n if (!this.isFirstPageCallMade) {\n return true;\n }\n return !!window.COMSCORE;\n }\n\n isReady() {\n return !!window.COMSCORE;\n }\n}\n\nexport { Comscore };\n","import is from \"is\";\nimport each from \"@ndhoule/each\";\nimport ScriptLoader from \"../ScriptLoader\";\nimport logger from \"../../utils/logUtil\";\n\nclass FacebookPixel {\n constructor(config) {\n this.blacklistPiiProperties = config.blacklistPiiProperties;\n this.categoryToContent = config.categoryToContent;\n this.pixelId = config.pixelId;\n this.eventsToEvents = config.eventsToEvents;\n this.eventCustomProperties = config.eventCustomProperties;\n this.valueFieldIdentifier = config.valueFieldIdentifier;\n this.advancedMapping = config.advancedMapping;\n this.traitKeyToExternalId = config.traitKeyToExternalId;\n this.legacyConversionPixelId = config.legacyConversionPixelId;\n this.userIdAsPixelId = config.userIdAsPixelId;\n this.whitelistPiiProperties = config.whitelistPiiProperties;\n this.name = \"FB_PIXEL\";\n }\n\n init() {\n if (this.categoryToContent === undefined) {\n this.categoryToContent = [];\n }\n if (this.legacyConversionPixelId === undefined) {\n this.legacyConversionPixelId = [];\n }\n if (this.userIdAsPixelId === undefined) {\n this.userIdAsPixelId = [];\n }\n\n logger.debug(\"===in init FbPixel===\");\n\n window._fbq = function () {\n if (window.fbq.callMethod) {\n window.fbq.callMethod.apply(window.fbq, arguments);\n } else {\n window.fbq.queue.push(arguments);\n }\n };\n\n window.fbq = window.fbq || window._fbq;\n window.fbq.push = window.fbq;\n window.fbq.loaded = true;\n window.fbq.disablePushState = true; // disables automatic pageview tracking\n window.fbq.allowDuplicatePageViews = true; // enables fb\n window.fbq.version = \"2.0\";\n window.fbq.queue = [];\n\n window.fbq(\"init\", this.pixelId);\n ScriptLoader(\n \"fbpixel-integration\",\n \"https://connect.facebook.net/en_US/fbevents.js\"\n );\n }\n\n isLoaded() {\n logger.debug(\"in FBPixel isLoaded\");\n return !!(window.fbq && window.fbq.callMethod);\n }\n\n isReady() {\n logger.debug(\"in FBPixel isReady\");\n return !!(window.fbq && window.fbq.callMethod);\n }\n\n page(rudderElement) {\n window.fbq(\"track\", \"PageView\");\n }\n\n identify(rudderElement) {\n if (this.advancedMapping) {\n window.fbq(\"init\", this.pixelId, rudderElement.message.context.traits);\n }\n }\n\n track(rudderElement) {\n const self = this;\n const { event } = rudderElement.message;\n var revenue = this.formatRevenue(rudderElement.message.properties.revenue);\n const payload = this.buildPayLoad(rudderElement, true);\n\n if (this.categoryToContent === undefined) {\n this.categoryToContent = [];\n }\n if (this.legacyConversionPixelId === undefined) {\n this.legacyConversionPixelId = [];\n }\n if (this.userIdAsPixelId === undefined) {\n this.userIdAsPixelId = [];\n }\n\n payload.value = revenue;\n const standard = this.eventsToEvents;\n const legacy = this.legacyConversionPixelId;\n let standardTo;\n let legacyTo;\n\n standardTo = standard.reduce((filtered, standard) => {\n if (standard.from === event) {\n filtered.push(standard.to);\n }\n return filtered;\n }, []);\n\n legacyTo = legacy.reduce((filtered, legacy) => {\n if (legacy.from === event) {\n filtered.push(legacy.to);\n }\n return filtered;\n }, []);\n\n each((event) => {\n payload.currency = rudderElement.message.properties.currency || \"USD\";\n\n window.fbq(\"trackSingle\", self.pixelId, event, payload, {\n eventID: rudderElement.message.messageId,\n });\n }, standardTo);\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: revenue,\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n\n if (event === \"Product List Viewed\") {\n var contentType;\n var contentIds;\n var contents = [];\n var { products } = rudderElement.message.properties;\n var customProperties = this.buildPayLoad(rudderElement, true);\n\n if (Array.isArray(products)) {\n products.forEach(function (product) {\n const productId = product.product_id;\n if (productId) {\n contentIds.push(productId);\n contents.push({\n id: productId,\n quantity: rudderElement.message.properties.quantity,\n });\n }\n });\n }\n\n if (contentIds.length) {\n contentType = [\"product\"];\n } else {\n contentIds.push(rudderElement.message.properties.category || \"\");\n contents.push({\n id: rudderElement.message.properties.category || \"\",\n quantity: 1,\n });\n contentType = [\"product_group\"];\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"ViewContent\",\n this.merge(\n {\n content_ids: contentIds,\n content_type: this.getContentType(rudderElement, contentType),\n contents,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Product Viewed\") {\n var useValue = this.valueFieldIdentifier === \"properties.value\";\n var customProperties = this.buildPayLoad(rudderElement, true);\n\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"ViewContent\",\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Product Added\") {\n var useValue = this.valueFieldIdentifier === \"properties.value\";\n var customProperties = this.buildPayLoad(rudderElement, true);\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"AddToCart\",\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n this.merge(\n {\n content_ids: [\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n ],\n content_type: this.getContentType(rudderElement, [\"product\"]),\n\n content_name: rudderElement.message.properties.product_name || \"\",\n content_category: rudderElement.message.properties.category || \"\",\n currency: rudderElement.message.properties.currency,\n value: useValue\n ? this.formatRevenue(rudderElement.message.properties.value)\n : this.formatRevenue(rudderElement.message.properties.price),\n contents: [\n {\n id:\n rudderElement.message.properties.product_id ||\n rudderElement.message.properties.id ||\n rudderElement.message.properties.sku ||\n \"\",\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n },\n ],\n },\n customProperties\n );\n } else if (event === \"Order Completed\") {\n var { products } = rudderElement.message.properties;\n var customProperties = this.buildPayLoad(rudderElement, true);\n var revenue = this.formatRevenue(\n rudderElement.message.properties.revenue\n );\n\n var contentType = this.getContentType(rudderElement, [\"product\"]);\n var contentIds = [];\n var contents = [];\n\n for (var i = 0; i < products.length; i++) {\n var pId = product.product_id;\n contentIds.push(pId);\n var content = {\n id: pId,\n quantity: rudderElement.message.properties.quantity,\n };\n if (rudderElement.message.properties.price) {\n content.item_price = rudderElement.message.properties.price;\n }\n contents.push(content);\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"Purchase\",\n this.merge(\n {\n content_ids: contentIds,\n content_type: contentType,\n currency: rudderElement.message.properties.currency,\n value: revenue,\n contents,\n num_items: contentIds.length,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Products Searched\") {\n var customProperties = this.buildPayLoad(rudderElement, true);\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"Search\",\n this.merge(\n {\n search_string: rudderElement.message.properties.query,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n } else if (event === \"Checkout Started\") {\n var { products } = rudderElement.message.properties;\n var customProperties = this.buildPayLoad(rudderElement, true);\n var revenue = this.formatRevenue(\n rudderElement.message.properties.revenue\n );\n let contentCategory = rudderElement.message.properties.category;\n var contentIds = [];\n var contents = [];\n\n for (var i = 0; i < products.length; i++) {\n const product = products[i];\n var pId = product.product_id;\n contentIds.push(pId);\n var content = {\n id: pId,\n quantity: rudderElement.message.properties.quantity,\n item_price: rudderElement.message.properties.price,\n };\n if (rudderElement.message.properties.price) {\n content.item_price = rudderElement.message.properties.price;\n }\n contents.push(content);\n }\n if (!contentCategory && products[0] && products[0].category) {\n contentCategory = products[0].category;\n }\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n \"InitiateCheckout\",\n this.merge(\n {\n content_category: contentCategory,\n content_ids: contentIds,\n content_type: this.getContentType(rudderElement, [\"product\"]),\n currency: rudderElement.message.properties.currency,\n value: revenue,\n contents,\n num_items: contentIds.length,\n },\n customProperties\n ),\n {\n eventID: rudderElement.message.messageId,\n }\n );\n\n each((event) => {\n window.fbq(\n \"trackSingle\",\n self.pixelId,\n event,\n {\n currency: rudderElement.message.properties.currency,\n value: this.formatRevenue(rudderElement.message.properties.revenue),\n },\n {\n eventID: rudderElement.message.messageId,\n }\n );\n }, legacyTo);\n }\n }\n\n getContentType(rudderElement, defaultValue) {\n const { options } = rudderElement.message;\n if (options && options.contentType) {\n return [options.contentType];\n }\n\n let { category } = rudderElement.message.properties;\n if (!category) {\n const { products } = rudderElement.message.properties;\n if (products && products.length) {\n category = products[0].category;\n }\n }\n if (category) {\n const mapped = this.categoryToContent;\n let mappedTo;\n mappedTo = mapped.reduce((filtered, mapped) => {\n if (mapped.from == category) {\n filtered.push(mapped.to);\n }\n return filtered;\n }, []);\n if (mappedTo.length) {\n return mappedTo;\n }\n }\n return defaultValue;\n }\n\n merge(obj1, obj2) {\n const res = {};\n\n // All properties of obj1\n for (const propObj1 in obj1) {\n if (obj1.hasOwnProperty(propObj1)) {\n res[propObj1] = obj1[propObj1];\n }\n }\n\n // Extra properties of obj2\n for (const propObj2 in obj2) {\n if (obj2.hasOwnProperty(propObj2) && !res.hasOwnProperty(propObj2)) {\n res[propObj2] = obj2[propObj2];\n }\n }\n\n return res;\n }\n\n formatRevenue(revenue) {\n return Number(revenue || 0).toFixed(2);\n }\n\n buildPayLoad(rudderElement, isStandardEvent) {\n const dateFields = [\n \"checkinDate\",\n \"checkoutDate\",\n \"departingArrivalDate\",\n \"departingDepartureDate\",\n \"returningArrivalDate\",\n \"returningDepartureDate\",\n \"travelEnd\",\n \"travelStart\",\n ];\n const defaultPiiProperties = [\n \"email\",\n \"firstName\",\n \"lastName\",\n \"gender\",\n \"city\",\n \"country\",\n \"phone\",\n \"state\",\n \"zip\",\n \"birthday\",\n ];\n const whitelistPiiProperties = this.whitelistPiiProperties || [];\n const blacklistPiiProperties = this.blacklistPiiProperties || [];\n const eventCustomProperties = this.eventCustomProperties || [];\n const customPiiProperties = {};\n for (let i = 0; i < blacklistPiiProperties[i]; i++) {\n const configuration = blacklistPiiProperties[i];\n customPiiProperties[configuration.blacklistPiiProperties] =\n configuration.blacklistPiiHash;\n }\n const payload = {};\n const { properties } = rudderElement.message;\n\n for (const property in properties) {\n if (!properties.hasOwnProperty(property)) {\n continue;\n }\n\n if (isStandardEvent && eventCustomProperties.indexOf(property) < 0) {\n continue;\n }\n const value = properties[property];\n\n if (dateFields.indexOf(properties) >= 0) {\n if (is.date(value)) {\n payload[property] = value.toISOTring().split(\"T\")[0];\n continue;\n }\n }\n if (customPiiProperties.hasOwnProperty(property)) {\n if (customPiiProperties[property] && typeof value === \"string\") {\n payload[property] = sha256(value);\n }\n continue;\n }\n const isPropertyPii = defaultPiiProperties.indexOf(property) >= 0;\n const isProperyWhiteListed =\n whitelistPiiProperties.indexOf(property) >= 0;\n if (!isPropertyPii || isProperyWhiteListed) {\n payload[property] = value;\n }\n }\n return payload;\n }\n}\n\nexport { FacebookPixel };\n",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\t /*\n\t * Local polyfil of Object.create\n\t */\n\t var create = Object.create || (function () {\n\t function F() {};\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }())\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var i = 0; i < thatSigBytes; i += 4) {\n\t thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t var r = (function (m_w) {\n\t var m_w = m_w;\n\t var m_z = 0x3ade68b1;\n\t var mask = 0xffffffff;\n\n\t return function () {\n\t m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;\n\t m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;\n\t var result = ((m_z << 0x10) + m_w) & mask;\n\t result /= 0x100000000;\n\t result += 0.5;\n\t return result * (Math.random() > .5 ? 1 : -1);\n\t }\n\t });\n\n\t for (var i = 0, rcache; i < nBytes; i += 4) {\n\t var _r = r((rcache || Math.random()) * 0x100000000);\n\n\t rcache = _r() * 0x3ade67b7;\n\t words.push((_r() * 0x100000000) | 0);\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t var processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64 encoding strategy.\n\t */\n\t var Base64 = C_enc.Base64 = {\n\t /**\n\t * Converts a word array to a Base64 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Base64 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64 string to a word array.\n\t *\n\t * @param {string} base64Str The Base64 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64.parse(base64String);\n\t */\n\t parse: function (base64Str) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\n\treturn CryptoJS.enc.Base64;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Constants table\n\t var T = [];\n\n\t // Compute constants\n\t (function () {\n\t for (var i = 0; i < 64; i++) {\n\t T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;\n\t }\n\t }());\n\n\t /**\n\t * MD5 hash algorithm.\n\t */\n\t var MD5 = C_algo.MD5 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Swap endian\n\t for (var i = 0; i < 16; i++) {\n\t // Shortcuts\n\t var offset_i = offset + i;\n\t var M_offset_i = M[offset_i];\n\n\t M[offset_i] = (\n\t (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |\n\t (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n\t );\n\t }\n\n\t // Shortcuts\n\t var H = this._hash.words;\n\n\t var M_offset_0 = M[offset + 0];\n\t var M_offset_1 = M[offset + 1];\n\t var M_offset_2 = M[offset + 2];\n\t var M_offset_3 = M[offset + 3];\n\t var M_offset_4 = M[offset + 4];\n\t var M_offset_5 = M[offset + 5];\n\t var M_offset_6 = M[offset + 6];\n\t var M_offset_7 = M[offset + 7];\n\t var M_offset_8 = M[offset + 8];\n\t var M_offset_9 = M[offset + 9];\n\t var M_offset_10 = M[offset + 10];\n\t var M_offset_11 = M[offset + 11];\n\t var M_offset_12 = M[offset + 12];\n\t var M_offset_13 = M[offset + 13];\n\t var M_offset_14 = M[offset + 14];\n\t var M_offset_15 = M[offset + 15];\n\n\t // Working varialbes\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\n\t // Computation\n\t a = FF(a, b, c, d, M_offset_0, 7, T[0]);\n\t d = FF(d, a, b, c, M_offset_1, 12, T[1]);\n\t c = FF(c, d, a, b, M_offset_2, 17, T[2]);\n\t b = FF(b, c, d, a, M_offset_3, 22, T[3]);\n\t a = FF(a, b, c, d, M_offset_4, 7, T[4]);\n\t d = FF(d, a, b, c, M_offset_5, 12, T[5]);\n\t c = FF(c, d, a, b, M_offset_6, 17, T[6]);\n\t b = FF(b, c, d, a, M_offset_7, 22, T[7]);\n\t a = FF(a, b, c, d, M_offset_8, 7, T[8]);\n\t d = FF(d, a, b, c, M_offset_9, 12, T[9]);\n\t c = FF(c, d, a, b, M_offset_10, 17, T[10]);\n\t b = FF(b, c, d, a, M_offset_11, 22, T[11]);\n\t a = FF(a, b, c, d, M_offset_12, 7, T[12]);\n\t d = FF(d, a, b, c, M_offset_13, 12, T[13]);\n\t c = FF(c, d, a, b, M_offset_14, 17, T[14]);\n\t b = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n\t a = GG(a, b, c, d, M_offset_1, 5, T[16]);\n\t d = GG(d, a, b, c, M_offset_6, 9, T[17]);\n\t c = GG(c, d, a, b, M_offset_11, 14, T[18]);\n\t b = GG(b, c, d, a, M_offset_0, 20, T[19]);\n\t a = GG(a, b, c, d, M_offset_5, 5, T[20]);\n\t d = GG(d, a, b, c, M_offset_10, 9, T[21]);\n\t c = GG(c, d, a, b, M_offset_15, 14, T[22]);\n\t b = GG(b, c, d, a, M_offset_4, 20, T[23]);\n\t a = GG(a, b, c, d, M_offset_9, 5, T[24]);\n\t d = GG(d, a, b, c, M_offset_14, 9, T[25]);\n\t c = GG(c, d, a, b, M_offset_3, 14, T[26]);\n\t b = GG(b, c, d, a, M_offset_8, 20, T[27]);\n\t a = GG(a, b, c, d, M_offset_13, 5, T[28]);\n\t d = GG(d, a, b, c, M_offset_2, 9, T[29]);\n\t c = GG(c, d, a, b, M_offset_7, 14, T[30]);\n\t b = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n\t a = HH(a, b, c, d, M_offset_5, 4, T[32]);\n\t d = HH(d, a, b, c, M_offset_8, 11, T[33]);\n\t c = HH(c, d, a, b, M_offset_11, 16, T[34]);\n\t b = HH(b, c, d, a, M_offset_14, 23, T[35]);\n\t a = HH(a, b, c, d, M_offset_1, 4, T[36]);\n\t d = HH(d, a, b, c, M_offset_4, 11, T[37]);\n\t c = HH(c, d, a, b, M_offset_7, 16, T[38]);\n\t b = HH(b, c, d, a, M_offset_10, 23, T[39]);\n\t a = HH(a, b, c, d, M_offset_13, 4, T[40]);\n\t d = HH(d, a, b, c, M_offset_0, 11, T[41]);\n\t c = HH(c, d, a, b, M_offset_3, 16, T[42]);\n\t b = HH(b, c, d, a, M_offset_6, 23, T[43]);\n\t a = HH(a, b, c, d, M_offset_9, 4, T[44]);\n\t d = HH(d, a, b, c, M_offset_12, 11, T[45]);\n\t c = HH(c, d, a, b, M_offset_15, 16, T[46]);\n\t b = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n\t a = II(a, b, c, d, M_offset_0, 6, T[48]);\n\t d = II(d, a, b, c, M_offset_7, 10, T[49]);\n\t c = II(c, d, a, b, M_offset_14, 15, T[50]);\n\t b = II(b, c, d, a, M_offset_5, 21, T[51]);\n\t a = II(a, b, c, d, M_offset_12, 6, T[52]);\n\t d = II(d, a, b, c, M_offset_3, 10, T[53]);\n\t c = II(c, d, a, b, M_offset_10, 15, T[54]);\n\t b = II(b, c, d, a, M_offset_1, 21, T[55]);\n\t a = II(a, b, c, d, M_offset_8, 6, T[56]);\n\t d = II(d, a, b, c, M_offset_15, 10, T[57]);\n\t c = II(c, d, a, b, M_offset_6, 15, T[58]);\n\t b = II(b, c, d, a, M_offset_13, 21, T[59]);\n\t a = II(a, b, c, d, M_offset_4, 6, T[60]);\n\t d = II(d, a, b, c, M_offset_11, 10, T[61]);\n\t c = II(c, d, a, b, M_offset_2, 15, T[62]);\n\t b = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\n\t var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n\t var nBitsTotalL = nBitsTotal;\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (\n\t (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)\n\t );\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n\t (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |\n\t (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)\n\t );\n\n\t data.sigBytes = (dataWords.length + 1) * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Shortcuts\n\t var hash = this._hash;\n\t var H = hash.words;\n\n\t // Swap endian\n\t for (var i = 0; i < 4; i++) {\n\t // Shortcut\n\t var H_i = H[i];\n\n\t H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |\n\t (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n\t }\n\n\t // Return final computed hash\n\t return hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t function FF(a, b, c, d, x, s, t) {\n\t var n = a + ((b & c) | (~b & d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function GG(a, b, c, d, x, s, t) {\n\t var n = a + ((b & d) | (c & ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function HH(a, b, c, d, x, s, t) {\n\t var n = a + (b ^ c ^ d) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t function II(a, b, c, d, x, s, t) {\n\t var n = a + (c ^ (b | ~d)) + x + t;\n\t return ((n << s) | (n >>> (32 - s))) + b;\n\t }\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.MD5('message');\n\t * var hash = CryptoJS.MD5(wordArray);\n\t */\n\t C.MD5 = Hasher._createHelper(MD5);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacMD5(message, key);\n\t */\n\t C.HmacMD5 = Hasher._createHmacHelper(MD5);\n\t}(Math));\n\n\n\treturn CryptoJS.MD5;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-1 hash algorithm.\n\t */\n\t var SHA1 = C_algo.SHA1 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init([\n\t 0x67452301, 0xefcdab89,\n\t 0x98badcfe, 0x10325476,\n\t 0xc3d2e1f0\n\t ]);\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\n\t // Computation\n\t for (var i = 0; i < 80; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n\t W[i] = (n << 1) | (n >>> 31);\n\t }\n\n\t var t = ((a << 5) | (a >>> 27)) + e + W[i];\n\t if (i < 20) {\n\t t += ((b & c) | (~b & d)) + 0x5a827999;\n\t } else if (i < 40) {\n\t t += (b ^ c ^ d) + 0x6ed9eba1;\n\t } else if (i < 60) {\n\t t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n\t } else /* if (i < 80) */ {\n\t t += (b ^ c ^ d) - 0x359d3e2a;\n\t }\n\n\t e = d;\n\t d = c;\n\t c = (b << 30) | (b >>> 2);\n\t b = a;\n\t a = t;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA1('message');\n\t * var hash = CryptoJS.SHA1(wordArray);\n\t */\n\t C.SHA1 = Hasher._createHelper(SHA1);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA1(message, key);\n\t */\n\t C.HmacSHA1 = Hasher._createHmacHelper(SHA1);\n\t}());\n\n\n\treturn CryptoJS.SHA1;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var C_algo = C.algo;\n\n\t /**\n\t * HMAC algorithm.\n\t */\n\t var HMAC = C_algo.HMAC = Base.extend({\n\t /**\n\t * Initializes a newly created HMAC.\n\t *\n\t * @param {Hasher} hasher The hash algorithm to use.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @example\n\t *\n\t * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n\t */\n\t init: function (hasher, key) {\n\t // Init hasher\n\t hasher = this._hasher = new hasher.init();\n\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof key == 'string') {\n\t key = Utf8.parse(key);\n\t }\n\n\t // Shortcuts\n\t var hasherBlockSize = hasher.blockSize;\n\t var hasherBlockSizeBytes = hasherBlockSize * 4;\n\n\t // Allow arbitrary length keys\n\t if (key.sigBytes > hasherBlockSizeBytes) {\n\t key = hasher.finalize(key);\n\t }\n\n\t // Clamp excess bits\n\t key.clamp();\n\n\t // Clone key for inner and outer pads\n\t var oKey = this._oKey = key.clone();\n\t var iKey = this._iKey = key.clone();\n\n\t // Shortcuts\n\t var oKeyWords = oKey.words;\n\t var iKeyWords = iKey.words;\n\n\t // XOR keys with pad constants\n\t for (var i = 0; i < hasherBlockSize; i++) {\n\t oKeyWords[i] ^= 0x5c5c5c5c;\n\t iKeyWords[i] ^= 0x36363636;\n\t }\n\t oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this HMAC to its initial state.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.reset();\n\t */\n\t reset: function () {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Reset\n\t hasher.reset();\n\t hasher.update(this._iKey);\n\t },\n\n\t /**\n\t * Updates this HMAC with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {HMAC} This HMAC instance.\n\t *\n\t * @example\n\t *\n\t * hmacHasher.update('message');\n\t * hmacHasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t this._hasher.update(messageUpdate);\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the HMAC computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @example\n\t *\n\t * var hmac = hmacHasher.finalize();\n\t * var hmac = hmacHasher.finalize('message');\n\t * var hmac = hmacHasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Shortcut\n\t var hasher = this._hasher;\n\n\t // Compute HMAC\n\t var innerHash = hasher.finalize(messageUpdate);\n\t hasher.reset();\n\t var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n\t return hmac;\n\t }\n\t });\n\t}());\n\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./sha1\"), require(\"./hmac\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./sha1\", \"./hmac\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var C_algo = C.algo;\n\t var MD5 = C_algo.MD5;\n\n\t /**\n\t * This key derivation function is meant to conform with EVP_BytesToKey.\n\t * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n\t */\n\t var EvpKDF = C_algo.EvpKDF = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n\t * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n\t * @property {number} iterations The number of iterations to perform. Default: 1\n\t */\n\t cfg: Base.extend({\n\t keySize: 128/32,\n\t hasher: MD5,\n\t iterations: 1\n\t }),\n\n\t /**\n\t * Initializes a newly created key derivation function.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n\t *\n\t * @example\n\t *\n\t * var kdf = CryptoJS.algo.EvpKDF.create();\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n\t * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n\t */\n\t init: function (cfg) {\n\t this.cfg = this.cfg.extend(cfg);\n\t },\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @example\n\t *\n\t * var key = kdf.compute(password, salt);\n\t */\n\t compute: function (password, salt) {\n\t // Shortcut\n\t var cfg = this.cfg;\n\n\t // Init hasher\n\t var hasher = cfg.hasher.create();\n\n\t // Initial values\n\t var derivedKey = WordArray.create();\n\n\t // Shortcuts\n\t var derivedKeyWords = derivedKey.words;\n\t var keySize = cfg.keySize;\n\t var iterations = cfg.iterations;\n\n\t // Generate key\n\t while (derivedKeyWords.length < keySize) {\n\t if (block) {\n\t hasher.update(block);\n\t }\n\t var block = hasher.update(password).finalize(salt);\n\t hasher.reset();\n\n\t // Iterations\n\t for (var i = 1; i < iterations; i++) {\n\t block = hasher.finalize(block);\n\t hasher.reset();\n\t }\n\n\t derivedKey.concat(block);\n\t }\n\t derivedKey.sigBytes = keySize * 4;\n\n\t return derivedKey;\n\t }\n\t });\n\n\t /**\n\t * Derives a key from a password.\n\t *\n\t * @param {WordArray|string} password The password.\n\t * @param {WordArray|string} salt A salt.\n\t * @param {Object} cfg (Optional) The configuration options to use for this computation.\n\t *\n\t * @return {WordArray} The derived key.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var key = CryptoJS.EvpKDF(password, salt);\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n\t * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n\t */\n\t C.EvpKDF = function (password, salt, cfg) {\n\t return EvpKDF.create(cfg).compute(password, salt);\n\t };\n\t}());\n\n\n\treturn CryptoJS.EvpKDF;\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./evpkdf\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./evpkdf\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t/**\n\t * Cipher core components.\n\t */\n\tCryptoJS.lib.Cipher || (function (undefined) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var Base = C_lib.Base;\n\t var WordArray = C_lib.WordArray;\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;\n\t var C_enc = C.enc;\n\t var Utf8 = C_enc.Utf8;\n\t var Base64 = C_enc.Base64;\n\t var C_algo = C.algo;\n\t var EvpKDF = C_algo.EvpKDF;\n\n\t /**\n\t * Abstract base cipher template.\n\t *\n\t * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n\t * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n\t * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n\t * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n\t */\n\t var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {WordArray} iv The IV to use for this operation.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Creates this cipher in encryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createEncryptor: function (key, cfg) {\n\t return this.create(this._ENC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Creates this cipher in decryption mode.\n\t *\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {Cipher} A cipher instance.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n\t */\n\t createDecryptor: function (key, cfg) {\n\t return this.create(this._DEC_XFORM_MODE, key, cfg);\n\t },\n\n\t /**\n\t * Initializes a newly created cipher.\n\t *\n\t * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @example\n\t *\n\t * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });\n\t */\n\t init: function (xformMode, key, cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Store transform mode and key\n\t this._xformMode = xformMode;\n\t this._key = key;\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this cipher to its initial state.\n\t *\n\t * @example\n\t *\n\t * cipher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-cipher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Adds data to be encrypted or decrypted.\n\t *\n\t * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.process('data');\n\t * var encrypted = cipher.process(wordArray);\n\t */\n\t process: function (dataUpdate) {\n\t // Append\n\t this._append(dataUpdate);\n\n\t // Process available blocks\n\t return this._process();\n\t },\n\n\t /**\n\t * Finalizes the encryption or decryption process.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n\t *\n\t * @return {WordArray} The data after final processing.\n\t *\n\t * @example\n\t *\n\t * var encrypted = cipher.finalize();\n\t * var encrypted = cipher.finalize('data');\n\t * var encrypted = cipher.finalize(wordArray);\n\t */\n\t finalize: function (dataUpdate) {\n\t // Final data update\n\t if (dataUpdate) {\n\t this._append(dataUpdate);\n\t }\n\n\t // Perform concrete-cipher logic\n\t var finalProcessedData = this._doFinalize();\n\n\t return finalProcessedData;\n\t },\n\n\t keySize: 128/32,\n\n\t ivSize: 128/32,\n\n\t _ENC_XFORM_MODE: 1,\n\n\t _DEC_XFORM_MODE: 2,\n\n\t /**\n\t * Creates shortcut functions to a cipher's object interface.\n\t *\n\t * @param {Cipher} cipher The cipher to create a helper for.\n\t *\n\t * @return {Object} An object with encrypt and decrypt shortcut functions.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n\t */\n\t _createHelper: (function () {\n\t function selectCipherStrategy(key) {\n\t if (typeof key == 'string') {\n\t return PasswordBasedCipher;\n\t } else {\n\t return SerializableCipher;\n\t }\n\t }\n\n\t return function (cipher) {\n\t return {\n\t encrypt: function (message, key, cfg) {\n\t return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);\n\t },\n\n\t decrypt: function (ciphertext, key, cfg) {\n\t return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);\n\t }\n\t };\n\t };\n\t }())\n\t });\n\n\t /**\n\t * Abstract base stream cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n\t */\n\t var StreamCipher = C_lib.StreamCipher = Cipher.extend({\n\t _doFinalize: function () {\n\t // Process partial blocks\n\t var finalProcessedBlocks = this._process(!!'flush');\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 1\n\t });\n\n\t /**\n\t * Mode namespace.\n\t */\n\t var C_mode = C.mode = {};\n\n\t /**\n\t * Abstract base block cipher mode template.\n\t */\n\t var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({\n\t /**\n\t * Creates this mode for encryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n\t */\n\t createEncryptor: function (cipher, iv) {\n\t return this.Encryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Creates this mode for decryption.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n\t */\n\t createDecryptor: function (cipher, iv) {\n\t return this.Decryptor.create(cipher, iv);\n\t },\n\n\t /**\n\t * Initializes a newly created mode.\n\t *\n\t * @param {Cipher} cipher A block cipher instance.\n\t * @param {Array} iv The IV words.\n\t *\n\t * @example\n\t *\n\t * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n\t */\n\t init: function (cipher, iv) {\n\t this._cipher = cipher;\n\t this._iv = iv;\n\t }\n\t });\n\n\t /**\n\t * Cipher Block Chaining mode.\n\t */\n\t var CBC = C_mode.CBC = (function () {\n\t /**\n\t * Abstract base CBC mode.\n\t */\n\t var CBC = BlockCipherMode.extend();\n\n\t /**\n\t * CBC encryptor.\n\t */\n\t CBC.Encryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // XOR and encrypt\n\t xorBlock.call(this, words, offset, blockSize);\n\t cipher.encryptBlock(words, offset);\n\n\t // Remember this block to use with next block\n\t this._prevBlock = words.slice(offset, offset + blockSize);\n\t }\n\t });\n\n\t /**\n\t * CBC decryptor.\n\t */\n\t CBC.Decryptor = CBC.extend({\n\t /**\n\t * Processes the data block at offset.\n\t *\n\t * @param {Array} words The data words to operate on.\n\t * @param {number} offset The offset where the block starts.\n\t *\n\t * @example\n\t *\n\t * mode.processBlock(data.words, offset);\n\t */\n\t processBlock: function (words, offset) {\n\t // Shortcuts\n\t var cipher = this._cipher;\n\t var blockSize = cipher.blockSize;\n\n\t // Remember this block to use with next block\n\t var thisBlock = words.slice(offset, offset + blockSize);\n\n\t // Decrypt and XOR\n\t cipher.decryptBlock(words, offset);\n\t xorBlock.call(this, words, offset, blockSize);\n\n\t // This block becomes the previous block\n\t this._prevBlock = thisBlock;\n\t }\n\t });\n\n\t function xorBlock(words, offset, blockSize) {\n\t // Shortcut\n\t var iv = this._iv;\n\n\t // Choose mixing block\n\t if (iv) {\n\t var block = iv;\n\n\t // Remove IV for subsequent blocks\n\t this._iv = undefined;\n\t } else {\n\t var block = this._prevBlock;\n\t }\n\n\t // XOR blocks\n\t for (var i = 0; i < blockSize; i++) {\n\t words[offset + i] ^= block[i];\n\t }\n\t }\n\n\t return CBC;\n\t }());\n\n\t /**\n\t * Padding namespace.\n\t */\n\t var C_pad = C.pad = {};\n\n\t /**\n\t * PKCS #5/7 padding strategy.\n\t */\n\t var Pkcs7 = C_pad.Pkcs7 = {\n\t /**\n\t * Pads data using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to pad.\n\t * @param {number} blockSize The multiple that the data should be padded to.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n\t */\n\t pad: function (data, blockSize) {\n\t // Shortcut\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count padding bytes\n\t var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;\n\n\t // Create padding word\n\t var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;\n\n\t // Create padding\n\t var paddingWords = [];\n\t for (var i = 0; i < nPaddingBytes; i += 4) {\n\t paddingWords.push(paddingWord);\n\t }\n\t var padding = WordArray.create(paddingWords, nPaddingBytes);\n\n\t // Add padding\n\t data.concat(padding);\n\t },\n\n\t /**\n\t * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n\t *\n\t * @param {WordArray} data The data to unpad.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * CryptoJS.pad.Pkcs7.unpad(wordArray);\n\t */\n\t unpad: function (data) {\n\t // Get number of padding bytes from last byte\n\t var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;\n\n\t // Remove padding\n\t data.sigBytes -= nPaddingBytes;\n\t }\n\t };\n\n\t /**\n\t * Abstract base block cipher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n\t */\n\t var BlockCipher = C_lib.BlockCipher = Cipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Mode} mode The block mode to use. Default: CBC\n\t * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n\t */\n\t cfg: Cipher.cfg.extend({\n\t mode: CBC,\n\t padding: Pkcs7\n\t }),\n\n\t reset: function () {\n\t // Reset cipher\n\t Cipher.reset.call(this);\n\n\t // Shortcuts\n\t var cfg = this.cfg;\n\t var iv = cfg.iv;\n\t var mode = cfg.mode;\n\n\t // Reset block mode\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t var modeCreator = mode.createEncryptor;\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t var modeCreator = mode.createDecryptor;\n\t // Keep at least one block in the buffer for unpadding\n\t this._minBufferSize = 1;\n\t }\n\n\t if (this._mode && this._mode.__creator == modeCreator) {\n\t this._mode.init(this, iv && iv.words);\n\t } else {\n\t this._mode = modeCreator.call(mode, this, iv && iv.words);\n\t this._mode.__creator = modeCreator;\n\t }\n\t },\n\n\t _doProcessBlock: function (words, offset) {\n\t this._mode.processBlock(words, offset);\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcut\n\t var padding = this.cfg.padding;\n\n\t // Finalize\n\t if (this._xformMode == this._ENC_XFORM_MODE) {\n\t // Pad data\n\t padding.pad(this._data, this.blockSize);\n\n\t // Process final blocks\n\t var finalProcessedBlocks = this._process(!!'flush');\n\t } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n\t // Process final blocks\n\t var finalProcessedBlocks = this._process(!!'flush');\n\n\t // Unpad data\n\t padding.unpad(finalProcessedBlocks);\n\t }\n\n\t return finalProcessedBlocks;\n\t },\n\n\t blockSize: 128/32\n\t });\n\n\t /**\n\t * A collection of cipher parameters.\n\t *\n\t * @property {WordArray} ciphertext The raw ciphertext.\n\t * @property {WordArray} key The key to this ciphertext.\n\t * @property {WordArray} iv The IV used in the ciphering operation.\n\t * @property {WordArray} salt The salt used with a key derivation function.\n\t * @property {Cipher} algorithm The cipher algorithm.\n\t * @property {Mode} mode The block mode used in the ciphering operation.\n\t * @property {Padding} padding The padding scheme used in the ciphering operation.\n\t * @property {number} blockSize The block size of the cipher.\n\t * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.\n\t */\n\t var CipherParams = C_lib.CipherParams = Base.extend({\n\t /**\n\t * Initializes a newly created cipher params object.\n\t *\n\t * @param {Object} cipherParams An object with any of the possible cipher parameters.\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.lib.CipherParams.create({\n\t * ciphertext: ciphertextWordArray,\n\t * key: keyWordArray,\n\t * iv: ivWordArray,\n\t * salt: saltWordArray,\n\t * algorithm: CryptoJS.algo.AES,\n\t * mode: CryptoJS.mode.CBC,\n\t * padding: CryptoJS.pad.PKCS7,\n\t * blockSize: 4,\n\t * formatter: CryptoJS.format.OpenSSL\n\t * });\n\t */\n\t init: function (cipherParams) {\n\t this.mixIn(cipherParams);\n\t },\n\n\t /**\n\t * Converts this cipher params object to a string.\n\t *\n\t * @param {Format} formatter (Optional) The formatting strategy to use.\n\t *\n\t * @return {string} The stringified cipher params.\n\t *\n\t * @throws Error If neither the formatter nor the default formatter is set.\n\t *\n\t * @example\n\t *\n\t * var string = cipherParams + '';\n\t * var string = cipherParams.toString();\n\t * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n\t */\n\t toString: function (formatter) {\n\t return (formatter || this.formatter).stringify(this);\n\t }\n\t });\n\n\t /**\n\t * Format namespace.\n\t */\n\t var C_format = C.format = {};\n\n\t /**\n\t * OpenSSL formatting strategy.\n\t */\n\t var OpenSSLFormatter = C_format.OpenSSL = {\n\t /**\n\t * Converts a cipher params object to an OpenSSL-compatible string.\n\t *\n\t * @param {CipherParams} cipherParams The cipher params object.\n\t *\n\t * @return {string} The OpenSSL-compatible string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n\t */\n\t stringify: function (cipherParams) {\n\t // Shortcuts\n\t var ciphertext = cipherParams.ciphertext;\n\t var salt = cipherParams.salt;\n\n\t // Format\n\t if (salt) {\n\t var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n\t } else {\n\t var wordArray = ciphertext;\n\t }\n\n\t return wordArray.toString(Base64);\n\t },\n\n\t /**\n\t * Converts an OpenSSL-compatible string to a cipher params object.\n\t *\n\t * @param {string} openSSLStr The OpenSSL-compatible string.\n\t *\n\t * @return {CipherParams} The cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n\t */\n\t parse: function (openSSLStr) {\n\t // Parse base64\n\t var ciphertext = Base64.parse(openSSLStr);\n\n\t // Shortcut\n\t var ciphertextWords = ciphertext.words;\n\n\t // Test for salt\n\t if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {\n\t // Extract salt\n\t var salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n\t // Remove salt from ciphertext\n\t ciphertextWords.splice(0, 4);\n\t ciphertext.sigBytes -= 16;\n\t }\n\n\t return CipherParams.create({ ciphertext: ciphertext, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n\t */\n\t var SerializableCipher = C_lib.SerializableCipher = Base.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL\n\t */\n\t cfg: Base.extend({\n\t format: OpenSSLFormatter\n\t }),\n\n\t /**\n\t * Encrypts a message.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Encrypt\n\t var encryptor = cipher.createEncryptor(key, cfg);\n\t var ciphertext = encryptor.finalize(message);\n\n\t // Shortcut\n\t var cipherCfg = encryptor.cfg;\n\n\t // Create and return serializable cipher params\n\t return CipherParams.create({\n\t ciphertext: ciphertext,\n\t key: key,\n\t iv: cipherCfg.iv,\n\t algorithm: cipher,\n\t mode: cipherCfg.mode,\n\t padding: cipherCfg.padding,\n\t blockSize: cipher.blockSize,\n\t formatter: cfg.format\n\t });\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {WordArray} key The key.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, key, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Decrypt\n\t var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);\n\n\t return plaintext;\n\t },\n\n\t /**\n\t * Converts serialized ciphertext to CipherParams,\n\t * else assumed CipherParams already and returns ciphertext unchanged.\n\t *\n\t * @param {CipherParams|string} ciphertext The ciphertext.\n\t * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n\t *\n\t * @return {CipherParams} The unserialized ciphertext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);\n\t */\n\t _parse: function (ciphertext, format) {\n\t if (typeof ciphertext == 'string') {\n\t return format.parse(ciphertext, this);\n\t } else {\n\t return ciphertext;\n\t }\n\t }\n\t });\n\n\t /**\n\t * Key derivation function namespace.\n\t */\n\t var C_kdf = C.kdf = {};\n\n\t /**\n\t * OpenSSL key derivation function.\n\t */\n\t var OpenSSLKdf = C_kdf.OpenSSL = {\n\t /**\n\t * Derives a key and IV from a password.\n\t *\n\t * @param {string} password The password to derive from.\n\t * @param {number} keySize The size in words of the key to generate.\n\t * @param {number} ivSize The size in words of the IV to generate.\n\t * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n\t *\n\t * @return {CipherParams} A cipher params object with the key, IV, and salt.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n\t * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n\t */\n\t execute: function (password, keySize, ivSize, salt) {\n\t // Generate random salt\n\t if (!salt) {\n\t salt = WordArray.random(64/8);\n\t }\n\n\t // Derive key and IV\n\t var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);\n\n\t // Separate key and IV\n\t var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n\t key.sigBytes = keySize * 4;\n\n\t // Return params\n\t return CipherParams.create({ key: key, iv: iv, salt: salt });\n\t }\n\t };\n\n\t /**\n\t * A serializable cipher wrapper that derives the key from a password,\n\t * and returns ciphertext as a serializable cipher params object.\n\t */\n\t var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({\n\t /**\n\t * Configuration options.\n\t *\n\t * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL\n\t */\n\t cfg: SerializableCipher.cfg.extend({\n\t kdf: OpenSSLKdf\n\t }),\n\n\t /**\n\t * Encrypts a message using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {WordArray|string} message The message to encrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {CipherParams} A cipher params object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');\n\t * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t encrypt: function (cipher, message, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Encrypt\n\t var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);\n\n\t // Mix in derived params\n\t ciphertext.mixIn(derivedParams);\n\n\t return ciphertext;\n\t },\n\n\t /**\n\t * Decrypts serialized ciphertext using a password.\n\t *\n\t * @param {Cipher} cipher The cipher algorithm to use.\n\t * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n\t * @param {string} password The password.\n\t * @param {Object} cfg (Optional) The configuration options to use for this operation.\n\t *\n\t * @return {WordArray} The plaintext.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });\n\t * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });\n\t */\n\t decrypt: function (cipher, ciphertext, password, cfg) {\n\t // Apply config defaults\n\t cfg = this.cfg.extend(cfg);\n\n\t // Convert string to CipherParams\n\t ciphertext = this._parse(ciphertext, cfg.format);\n\n\t // Derive key and other params\n\t var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);\n\n\t // Add IV to config\n\t cfg.iv = derivedParams.iv;\n\n\t // Decrypt\n\t var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);\n\n\t return plaintext;\n\t }\n\t });\n\t}());\n\n\n}));",";(function (root, factory, undef) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"), require(\"./enc-base64\"), require(\"./md5\"), require(\"./evpkdf\"), require(\"./cipher-core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\", \"./enc-base64\", \"./md5\", \"./evpkdf\", \"./cipher-core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var BlockCipher = C_lib.BlockCipher;\n\t var C_algo = C.algo;\n\n\t // Lookup tables\n\t var SBOX = [];\n\t var INV_SBOX = [];\n\t var SUB_MIX_0 = [];\n\t var SUB_MIX_1 = [];\n\t var SUB_MIX_2 = [];\n\t var SUB_MIX_3 = [];\n\t var INV_SUB_MIX_0 = [];\n\t var INV_SUB_MIX_1 = [];\n\t var INV_SUB_MIX_2 = [];\n\t var INV_SUB_MIX_3 = [];\n\n\t // Compute lookup tables\n\t (function () {\n\t // Compute double table\n\t var d = [];\n\t for (var i = 0; i < 256; i++) {\n\t if (i < 128) {\n\t d[i] = i << 1;\n\t } else {\n\t d[i] = (i << 1) ^ 0x11b;\n\t }\n\t }\n\n\t // Walk GF(2^8)\n\t var x = 0;\n\t var xi = 0;\n\t for (var i = 0; i < 256; i++) {\n\t // Compute sbox\n\t var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n\t sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n\t SBOX[x] = sx;\n\t INV_SBOX[sx] = x;\n\n\t // Compute multiplication\n\t var x2 = d[x];\n\t var x4 = d[x2];\n\t var x8 = d[x4];\n\n\t // Compute sub bytes, mix columns tables\n\t var t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n\t SUB_MIX_0[x] = (t << 24) | (t >>> 8);\n\t SUB_MIX_1[x] = (t << 16) | (t >>> 16);\n\t SUB_MIX_2[x] = (t << 8) | (t >>> 24);\n\t SUB_MIX_3[x] = t;\n\n\t // Compute inv sub bytes, inv mix columns tables\n\t var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n\t INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);\n\t INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);\n\t INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);\n\t INV_SUB_MIX_3[sx] = t;\n\n\t // Compute next counter\n\t if (!x) {\n\t x = xi = 1;\n\t } else {\n\t x = x2 ^ d[d[d[x8 ^ x2]]];\n\t xi ^= d[d[xi]];\n\t }\n\t }\n\t }());\n\n\t // Precomputed Rcon lookup\n\t var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n\t /**\n\t * AES block cipher algorithm.\n\t */\n\t var AES = C_algo.AES = BlockCipher.extend({\n\t _doReset: function () {\n\t // Skip reset of nRounds has been set before and key did not change\n\t if (this._nRounds && this._keyPriorReset === this._key) {\n\t return;\n\t }\n\n\t // Shortcuts\n\t var key = this._keyPriorReset = this._key;\n\t var keyWords = key.words;\n\t var keySize = key.sigBytes / 4;\n\n\t // Compute number of rounds\n\t var nRounds = this._nRounds = keySize + 6;\n\n\t // Compute number of key schedule rows\n\t var ksRows = (nRounds + 1) * 4;\n\n\t // Compute key schedule\n\t var keySchedule = this._keySchedule = [];\n\t for (var ksRow = 0; ksRow < ksRows; ksRow++) {\n\t if (ksRow < keySize) {\n\t keySchedule[ksRow] = keyWords[ksRow];\n\t } else {\n\t var t = keySchedule[ksRow - 1];\n\n\t if (!(ksRow % keySize)) {\n\t // Rot word\n\t t = (t << 8) | (t >>> 24);\n\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\n\t // Mix Rcon\n\t t ^= RCON[(ksRow / keySize) | 0] << 24;\n\t } else if (keySize > 6 && ksRow % keySize == 4) {\n\t // Sub word\n\t t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];\n\t }\n\n\t keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n\t }\n\t }\n\n\t // Compute inv key schedule\n\t var invKeySchedule = this._invKeySchedule = [];\n\t for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {\n\t var ksRow = ksRows - invKsRow;\n\n\t if (invKsRow % 4) {\n\t var t = keySchedule[ksRow];\n\t } else {\n\t var t = keySchedule[ksRow - 4];\n\t }\n\n\t if (invKsRow < 4 || ksRow <= 4) {\n\t invKeySchedule[invKsRow] = t;\n\t } else {\n\t invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^\n\t INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];\n\t }\n\t }\n\t },\n\n\t encryptBlock: function (M, offset) {\n\t this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);\n\t },\n\n\t decryptBlock: function (M, offset) {\n\t // Swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\n\t this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);\n\n\t // Inv swap 2nd and 4th rows\n\t var t = M[offset + 1];\n\t M[offset + 1] = M[offset + 3];\n\t M[offset + 3] = t;\n\t },\n\n\t _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n\t // Shortcut\n\t var nRounds = this._nRounds;\n\n\t // Get input, add round key\n\t var s0 = M[offset] ^ keySchedule[0];\n\t var s1 = M[offset + 1] ^ keySchedule[1];\n\t var s2 = M[offset + 2] ^ keySchedule[2];\n\t var s3 = M[offset + 3] ^ keySchedule[3];\n\n\t // Key schedule row counter\n\t var ksRow = 4;\n\n\t // Rounds\n\t for (var round = 1; round < nRounds; round++) {\n\t // Shift rows, sub bytes, mix columns, add round key\n\t var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];\n\t var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];\n\t var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];\n\t var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];\n\n\t // Update state\n\t s0 = t0;\n\t s1 = t1;\n\t s2 = t2;\n\t s3 = t3;\n\t }\n\n\t // Shift rows, sub bytes, add round key\n\t var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];\n\t var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];\n\t var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];\n\t var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];\n\n\t // Set output\n\t M[offset] = t0;\n\t M[offset + 1] = t1;\n\t M[offset + 2] = t2;\n\t M[offset + 3] = t3;\n\t },\n\n\t keySize: 256/32\n\t });\n\n\t /**\n\t * Shortcut functions to the cipher's object interface.\n\t *\n\t * @example\n\t *\n\t * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n\t * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n\t */\n\t C.AES = BlockCipher._createHelper(AES);\n\t}());\n\n\n\treturn CryptoJS.AES;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\treturn CryptoJS.enc.Utf8;\n\n}));","/**\n * toString ref.\n */\n\nvar toString = Object.prototype.toString;\n\n/**\n * Return the type of `val`.\n *\n * @param {Mixed} val\n * @return {String}\n * @api public\n */\n\nmodule.exports = function(val){\n switch (toString.call(val)) {\n case '[object Date]': return 'date';\n case '[object RegExp]': return 'regexp';\n case '[object Arguments]': return 'arguments';\n case '[object Array]': return 'array';\n case '[object Error]': return 'error';\n }\n\n if (val === null) return 'null';\n if (val === undefined) return 'undefined';\n if (val !== val) return 'nan';\n if (val && val.nodeType === 1) return 'element';\n\n if (isBuffer(val)) return 'buffer';\n\n val = val.valueOf\n ? val.valueOf()\n : Object.prototype.valueOf.apply(val);\n\n return typeof val;\n};\n\n// code borrowed from https://github.com/feross/is-buffer/blob/master/index.js\nfunction isBuffer(obj) {\n return !!(obj != null &&\n (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor)\n (obj.constructor &&\n typeof obj.constructor.isBuffer === 'function' &&\n obj.constructor.isBuffer(obj))\n ))\n}\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar type = require('component-type');\n\n/**\n * Deeply clone an object.\n *\n * @param {*} obj Any object.\n */\n\nvar clone = function clone(obj) {\n var t = type(obj);\n\n if (t === 'object') {\n var copy = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n copy[key] = clone(obj[key]);\n }\n }\n return copy;\n }\n\n if (t === 'array') {\n var copy = new Array(obj.length);\n for (var i = 0, l = obj.length; i < l; i++) {\n copy[i] = clone(obj[i]);\n }\n return copy;\n }\n\n if (t === 'regexp') {\n // from millermedeiros/amd-utils - MIT\n var flags = '';\n flags += obj.multiline ? 'm' : '';\n flags += obj.global ? 'g' : '';\n flags += obj.ignoreCase ? 'i' : '';\n return new RegExp(obj.source, flags);\n }\n\n if (t === 'date') {\n return new Date(obj.getTime());\n }\n\n // string, number, boolean, etc.\n return obj;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = clone;\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 * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\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 = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\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 }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\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 long(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) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\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 = debug;\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, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % 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 debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\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 // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\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 = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-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 if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\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 var split = (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/**\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 // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\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 return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\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 args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\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-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 return args;\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 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.samesite) str += '; samesite=' + options.samesite;\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\nvar max = Math.max;\n\n/**\n * Produce a new array composed of all but the first `n` elements of an input `collection`.\n *\n * @name drop\n * @api public\n * @param {number} count The number of elements to drop.\n * @param {Array} collection The collection to iterate over.\n * @return {Array} A new array containing all but the first element from `collection`.\n * @example\n * drop(0, [1, 2, 3]); // => [1, 2, 3]\n * drop(1, [1, 2, 3]); // => [2, 3]\n * drop(2, [1, 2, 3]); // => [3]\n * drop(3, [1, 2, 3]); // => []\n * drop(4, [1, 2, 3]); // => []\n */\nvar drop = function drop(count, collection) {\n var length = collection ? collection.length : 0;\n\n if (!length) {\n return [];\n }\n\n // Preallocating an array *significantly* boosts performance when dealing with\n // `arguments` objects on v8. For a summary, see:\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var toDrop = max(Number(count) || 0, 0);\n var resultsLength = max(length - toDrop, 0);\n var results = new Array(resultsLength);\n\n for (var i = 0; i < resultsLength; i += 1) {\n results[i] = collection[i + toDrop];\n }\n\n return results;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = drop;\n","'use strict';\n\nvar max = Math.max;\n\n/**\n * Produce a new array by passing each value in the input `collection` through a transformative\n * `iterator` function. The `iterator` function is passed three arguments:\n * `(value, index, collection)`.\n *\n * @name rest\n * @api public\n * @param {Array} collection The collection to iterate over.\n * @return {Array} A new array containing all but the first element from `collection`.\n * @example\n * rest([1, 2, 3]); // => [2, 3]\n */\nvar rest = function rest(collection) {\n if (collection == null || !collection.length) {\n return [];\n }\n\n // Preallocating an array *significantly* boosts performance when dealing with\n // `arguments` objects on v8. For a summary, see:\n // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n var results = new Array(max(collection.length - 2, 0));\n\n for (var i = 1; i < collection.length; i += 1) {\n results[i - 1] = collection[i];\n }\n\n return results;\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = rest;\n","'use strict';\n\n/*\n * Module dependencies.\n */\n\nvar drop = require('@ndhoule/drop');\nvar rest = require('@ndhoule/rest');\n\nvar has = Object.prototype.hasOwnProperty;\nvar objToString = Object.prototype.toString;\n\n/**\n * Returns `true` if a value is an object, otherwise `false`.\n *\n * @name isObject\n * @api private\n * @param {*} val The value to test.\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isObject = function isObject(value) {\n return Boolean(value) && typeof value === 'object';\n};\n\n/**\n * Returns `true` if a value is a plain object, otherwise `false`.\n *\n * @name isPlainObject\n * @api private\n * @param {*} val The value to test.\n * @return {boolean}\n */\n// TODO: Move to a library\nvar isPlainObject = function isPlainObject(value) {\n return Boolean(value) && objToString.call(value) === '[object Object]';\n};\n\n/**\n * Assigns a key-value pair to a target object when the value assigned is owned,\n * and where target[key] is undefined.\n *\n * @name shallowCombiner\n * @api private\n * @param {Object} target\n * @param {Object} source\n * @param {*} value\n * @param {string} key\n */\nvar shallowCombiner = function shallowCombiner(target, source, value, key) {\n if (has.call(source, key) && target[key] === undefined) {\n target[key] = value;\n }\n return source;\n};\n\n/**\n * Assigns a key-value pair to a target object when the value assigned is owned,\n * and where target[key] is undefined; also merges objects recursively.\n *\n * @name deepCombiner\n * @api private\n * @param {Object} target\n * @param {Object} source\n * @param {*} value\n * @param {string} key\n * @return {Object}\n */\nvar deepCombiner = function(target, source, value, key) {\n if (has.call(source, key)) {\n if (isPlainObject(target[key]) && isPlainObject(value)) {\n target[key] = defaultsDeep(target[key], value);\n } else if (target[key] === undefined) {\n target[key] = value;\n }\n }\n\n return source;\n};\n\n/**\n * TODO: Document\n *\n * @name defaultsWith\n * @api private\n * @param {Function} combiner\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object} Return the input `target`.\n */\nvar defaultsWith = function(combiner, target /*, ...sources */) {\n if (!isObject(target)) {\n return target;\n }\n\n combiner = combiner || shallowCombiner;\n var sources = drop(2, arguments);\n\n for (var i = 0; i < sources.length; i += 1) {\n for (var key in sources[i]) {\n combiner(target, sources[i], sources[i][key], key);\n }\n }\n\n return target;\n};\n\n/**\n * Copies owned, enumerable properties from a source object(s) to a target\n * object when the value of that property on the source object is `undefined`.\n * Recurses on objects.\n *\n * @name defaultsDeep\n * @api public\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object} The input `target`.\n */\nvar defaultsDeep = function defaultsDeep(target /*, sources */) {\n // TODO: Replace with `partial` call?\n return defaultsWith.apply(null, [deepCombiner, target].concat(rest(arguments)));\n};\n\n/**\n * Copies owned, enumerable properties from a source object(s) to a target\n * object when the value of that property on the source object is `undefined`.\n *\n * @name defaults\n * @api public\n * @param {Object} target\n * @param {...Object} sources\n * @return {Object}\n * @example\n * var a = { a: 1 };\n * var b = { a: 2, b: 2 };\n *\n * defaults(a, b);\n * console.log(a); //=> { a: 1, b: 2 }\n */\nvar defaults = function(target /*, ...sources */) {\n // TODO: Replace with `partial` call?\n return defaultsWith.apply(null, [null, target].concat(rest(arguments)));\n};\n\n/*\n * Exports.\n */\n\nmodule.exports = defaults;\nmodule.exports.deep = defaultsDeep;\n","/*! JSON v3.3.2 | https://bestiejs.github.io/json3 | Copyright 2012-2015, Kit Cambridge, Benjamin Tan | http://kit.mit-license.org */\n;(function () {\n // Detect the `define` function exposed by asynchronous module loaders. The\n // strict `define` check is necessary for compatibility with `r.js`.\n var isLoader = typeof define === \"function\" && define.amd;\n\n // A set of types used to distinguish objects from primitives.\n var objectTypes = {\n \"function\": true,\n \"object\": true\n };\n\n // Detect the `exports` object exposed by CommonJS implementations.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Use the `global` object exposed by Node (including Browserify via\n // `insert-module-globals`), Narwhal, and Ringo as the default context,\n // and the `window` object in browsers. Rhino exports a `global` function\n // instead.\n var root = objectTypes[typeof window] && window || this,\n freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\n if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Public: Initializes JSON 3 using the given `context` object, attaching the\n // `stringify` and `parse` functions to the specified `exports` object.\n function runInContext(context, exports) {\n context || (context = root.Object());\n exports || (exports = root.Object());\n\n // Native constructor aliases.\n var Number = context.Number || root.Number,\n String = context.String || root.String,\n Object = context.Object || root.Object,\n Date = context.Date || root.Date,\n SyntaxError = context.SyntaxError || root.SyntaxError,\n TypeError = context.TypeError || root.TypeError,\n Math = context.Math || root.Math,\n nativeJSON = context.JSON || root.JSON;\n\n // Delegate to the native `stringify` and `parse` implementations.\n if (typeof nativeJSON == \"object\" && nativeJSON) {\n exports.stringify = nativeJSON.stringify;\n exports.parse = nativeJSON.parse;\n }\n\n // Convenience aliases.\n var objectProto = Object.prototype,\n getClass = objectProto.toString,\n isProperty = objectProto.hasOwnProperty,\n undefined;\n\n // Internal: Contains `try...catch` logic used by other functions.\n // This prevents other functions from being deoptimized.\n function attempt(func, errorFunc) {\n try {\n func();\n } catch (exception) {\n if (errorFunc) {\n errorFunc();\n }\n }\n }\n\n // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n var isExtended = new Date(-3509827334573292);\n attempt(function () {\n // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n // results for certain dates in Opera >= 10.53.\n isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n });\n\n // Internal: Determines whether the native `JSON.stringify` and `parse`\n // implementations are spec-compliant. Based on work by Ken Snyder.\n function has(name) {\n if (has[name] != null) {\n // Return cached feature test result.\n return has[name];\n }\n var isSupported;\n if (name == \"bug-string-char-index\") {\n // IE <= 7 doesn't support accessing string characters using square\n // bracket notation. IE 8 only supports this for primitives.\n isSupported = \"a\"[0] != \"a\";\n } else if (name == \"json\") {\n // Indicates whether both `JSON.stringify` and `JSON.parse` are\n // supported.\n isSupported = has(\"json-stringify\") && has(\"date-serialization\") && has(\"json-parse\");\n } else if (name == \"date-serialization\") {\n // Indicates whether `Date`s can be serialized accurately by `JSON.stringify`.\n isSupported = has(\"json-stringify\") && isExtended;\n if (isSupported) {\n var stringify = exports.stringify;\n attempt(function () {\n isSupported =\n // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n // serialize extended years.\n stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n // The milliseconds are optional in ES 5, but required in 5.1.\n stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n // four-digit years instead of six-digit years. Credits: @Yaffle.\n stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n // values less than 1000. Credits: @Yaffle.\n stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n });\n }\n } else {\n var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n // Test `JSON.stringify`.\n if (name == \"json-stringify\") {\n var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\";\n if (stringifySupported) {\n // A test function object with a custom `toJSON` method.\n (value = function () {\n return 1;\n }).toJSON = value;\n attempt(function () {\n stringifySupported =\n // Firefox 3.1b1 and b2 serialize string, number, and boolean\n // primitives as object literals.\n stringify(0) === \"0\" &&\n // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n // literals.\n stringify(new Number()) === \"0\" &&\n stringify(new String()) == '\"\"' &&\n // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n // does not define a canonical JSON representation (this applies to\n // objects with `toJSON` properties as well, *unless* they are nested\n // within an object or array).\n stringify(getClass) === undefined &&\n // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n // FF 3.1b3 pass this test.\n stringify(undefined) === undefined &&\n // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n // respectively, if the value is omitted entirely.\n stringify() === undefined &&\n // FF 3.1b1, 2 throw an error if the given value is not a number,\n // string, array, object, Boolean, or `null` literal. This applies to\n // objects with custom `toJSON` methods as well, unless they are nested\n // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n // methods entirely.\n stringify(value) === \"1\" &&\n stringify([value]) == \"[1]\" &&\n // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n // `\"[null]\"`.\n stringify([undefined]) == \"[null]\" &&\n // YUI 3.0.0b1 fails to serialize `null` literals.\n stringify(null) == \"null\" &&\n // FF 3.1b1, 2 halts serialization if an array contains a function:\n // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n // elides non-JSON values from objects and arrays, unless they\n // define custom `toJSON` methods.\n stringify([undefined, getClass, null]) == \"[null,null,null]\" &&\n // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n stringify(null, value) === \"1\" &&\n stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\";\n }, function () {\n stringifySupported = false;\n });\n }\n isSupported = stringifySupported;\n }\n // Test `JSON.parse`.\n if (name == \"json-parse\") {\n var parse = exports.parse, parseSupported;\n if (typeof parse == \"function\") {\n attempt(function () {\n // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n // Conforming implementations should also coerce the initial argument to\n // a string prior to parsing.\n if (parse(\"0\") === 0 && !parse(false)) {\n // Simple parsing test.\n value = parse(serialized);\n parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n if (parseSupported) {\n attempt(function () {\n // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n parseSupported = !parse('\"\\t\"');\n });\n if (parseSupported) {\n attempt(function () {\n // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n // certain octal literals.\n parseSupported = parse(\"01\") !== 1;\n });\n }\n if (parseSupported) {\n attempt(function () {\n // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n // points. These environments, along with FF 3.1b1 and 2,\n // also allow trailing commas in JSON objects and arrays.\n parseSupported = parse(\"1.\") !== 1;\n });\n }\n }\n }\n }, function () {\n parseSupported = false;\n });\n }\n isSupported = parseSupported;\n }\n }\n return has[name] = !!isSupported;\n }\n has[\"bug-string-char-index\"] = has[\"date-serialization\"] = has[\"json\"] = has[\"json-stringify\"] = has[\"json-parse\"] = null;\n\n if (!has(\"json\")) {\n // Common `[[Class]]` name aliases.\n var functionClass = \"[object Function]\",\n dateClass = \"[object Date]\",\n numberClass = \"[object Number]\",\n stringClass = \"[object String]\",\n arrayClass = \"[object Array]\",\n booleanClass = \"[object Boolean]\";\n\n // Detect incomplete support for accessing string characters by index.\n var charIndexBuggy = has(\"bug-string-char-index\");\n\n // Internal: Normalizes the `for...in` iteration algorithm across\n // environments. Each enumerated key is yielded to a `callback` function.\n var forOwn = function (object, callback) {\n var size = 0, Properties, dontEnums, property;\n\n // Tests for bugs in the current environment's `for...in` algorithm. The\n // `valueOf` property inherits the non-enumerable flag from\n // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n (Properties = function () {\n this.valueOf = 0;\n }).prototype.valueOf = 0;\n\n // Iterate over a new instance of the `Properties` class.\n dontEnums = new Properties();\n for (property in dontEnums) {\n // Ignore all properties inherited from `Object.prototype`.\n if (isProperty.call(dontEnums, property)) {\n size++;\n }\n }\n Properties = dontEnums = null;\n\n // Normalize the iteration algorithm.\n if (!size) {\n // A list of non-enumerable properties inherited from `Object.prototype`.\n dontEnums = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n // properties.\n forOwn = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, length;\n var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n for (property in object) {\n // Gecko <= 1.0 enumerates the `prototype` property of functions under\n // certain conditions; IE does not.\n if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n callback(property);\n }\n }\n // Manually invoke the callback for each non-enumerable property.\n for (length = dontEnums.length; property = dontEnums[--length];) {\n if (hasProperty.call(object, property)) {\n callback(property);\n }\n }\n };\n } else {\n // No bugs detected; use the standard `for...in` algorithm.\n forOwn = function (object, callback) {\n var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n for (property in object) {\n if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n callback(property);\n }\n }\n // Manually invoke the callback for the `constructor` property due to\n // cross-environment inconsistencies.\n if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n callback(property);\n }\n };\n }\n return forOwn(object, callback);\n };\n\n // Public: Serializes a JavaScript `value` as a JSON string. The optional\n // `filter` argument may specify either a function that alters how object and\n // array members are serialized, or an array of strings and numbers that\n // indicates which properties should be serialized. The optional `width`\n // argument may be either a string or number that specifies the indentation\n // level of the output.\n if (!has(\"json-stringify\") && !has(\"date-serialization\")) {\n // Internal: A map of control characters and their escaped equivalents.\n var Escapes = {\n 92: \"\\\\\\\\\",\n 34: '\\\\\"',\n 8: \"\\\\b\",\n 12: \"\\\\f\",\n 10: \"\\\\n\",\n 13: \"\\\\r\",\n 9: \"\\\\t\"\n };\n\n // Internal: Converts `value` into a zero-padded string such that its\n // length is at least equal to `width`. The `width` must be <= 6.\n var leadingZeroes = \"000000\";\n var toPaddedString = function (width, value) {\n // The `|| 0` expression is necessary to work around a bug in\n // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n return (leadingZeroes + (value || 0)).slice(-width);\n };\n\n // Internal: Serializes a date object.\n var serializeDate = function (value) {\n var getData, year, month, date, time, hours, minutes, seconds, milliseconds;\n // Define additional utility methods if the `Date` methods are buggy.\n if (!isExtended) {\n var floor = Math.floor;\n // A mapping between the months of the year and the number of days between\n // January 1st and the first of the respective month.\n var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n // Internal: Calculates the number of days between the Unix epoch and the\n // first day of the given month.\n var getDay = function (year, month) {\n return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n };\n getData = function (value) {\n // Manually compute the year, month, date, hours, minutes,\n // seconds, and milliseconds if the `getUTC*` methods are\n // buggy. Adapted from @Yaffle's `date-shim` project.\n date = floor(value / 864e5);\n for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n date = 1 + date - getDay(year, month);\n // The `time` value specifies the time within the day (see ES\n // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n // to compute `A modulo B`, as the `%` operator does not\n // correspond to the `modulo` operation for negative numbers.\n time = (value % 864e5 + 864e5) % 864e5;\n // The hours, minutes, seconds, and milliseconds are obtained by\n // decomposing the time within the day. See section 15.9.1.10.\n hours = floor(time / 36e5) % 24;\n minutes = floor(time / 6e4) % 60;\n seconds = floor(time / 1e3) % 60;\n milliseconds = time % 1e3;\n };\n } else {\n getData = function (value) {\n year = value.getUTCFullYear();\n month = value.getUTCMonth();\n date = value.getUTCDate();\n hours = value.getUTCHours();\n minutes = value.getUTCMinutes();\n seconds = value.getUTCSeconds();\n milliseconds = value.getUTCMilliseconds();\n };\n }\n serializeDate = function (value) {\n if (value > -1 / 0 && value < 1 / 0) {\n // Dates are serialized according to the `Date#toJSON` method\n // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n // for the ISO 8601 date time string format.\n getData(value);\n // Serialize extended years correctly.\n value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n // Months, dates, hours, minutes, and seconds should have two\n // digits; milliseconds should have three.\n \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n // Milliseconds are optional in ES 5.0, but required in 5.1.\n \".\" + toPaddedString(3, milliseconds) + \"Z\";\n year = month = date = hours = minutes = seconds = milliseconds = null;\n } else {\n value = null;\n }\n return value;\n };\n return serializeDate(value);\n };\n\n // For environments with `JSON.stringify` but buggy date serialization,\n // we override the native `Date#toJSON` implementation with a\n // spec-compliant one.\n if (has(\"json-stringify\") && !has(\"date-serialization\")) {\n // Internal: the `Date#toJSON` implementation used to override the native one.\n function dateToJSON (key) {\n return serializeDate(this);\n }\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n var nativeStringify = exports.stringify;\n exports.stringify = function (source, filter, width) {\n var nativeToJSON = Date.prototype.toJSON;\n Date.prototype.toJSON = dateToJSON;\n var result = nativeStringify(source, filter, width);\n Date.prototype.toJSON = nativeToJSON;\n return result;\n }\n } else {\n // Internal: Double-quotes a string `value`, replacing all ASCII control\n // characters (characters with code unit values between 0 and 31) with\n // their escaped equivalents. This is an implementation of the\n // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n var unicodePrefix = \"\\\\u00\";\n var escapeChar = function (character) {\n var charCode = character.charCodeAt(0), escaped = Escapes[charCode];\n if (escaped) {\n return escaped;\n }\n return unicodePrefix + toPaddedString(2, charCode.toString(16));\n };\n var reEscape = /[\\x00-\\x1f\\x22\\x5c]/g;\n var quote = function (value) {\n reEscape.lastIndex = 0;\n return '\"' +\n (\n reEscape.test(value)\n ? value.replace(reEscape, escapeChar)\n : value\n ) +\n '\"';\n };\n\n // Internal: Recursively serializes an object. Implements the\n // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n var value, type, className, results, element, index, length, prefix, result;\n attempt(function () {\n // Necessary for host object support.\n value = object[property];\n });\n if (typeof value == \"object\" && value) {\n if (value.getUTCFullYear && getClass.call(value) == dateClass && value.toJSON === Date.prototype.toJSON) {\n value = serializeDate(value);\n } else if (typeof value.toJSON == \"function\") {\n value = value.toJSON(property);\n }\n }\n if (callback) {\n // If a replacement function was provided, call it to obtain the value\n // for serialization.\n value = callback.call(object, property, value);\n }\n // Exit early if value is `undefined` or `null`.\n if (value == undefined) {\n return value === undefined ? value : \"null\";\n }\n type = typeof value;\n // Only call `getClass` if the value is an object.\n if (type == \"object\") {\n className = getClass.call(value);\n }\n switch (className || type) {\n case \"boolean\":\n case booleanClass:\n // Booleans are represented literally.\n return \"\" + value;\n case \"number\":\n case numberClass:\n // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n // `\"null\"`.\n return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n case \"string\":\n case stringClass:\n // Strings are double-quoted and escaped.\n return quote(\"\" + value);\n }\n // Recursively serialize objects and arrays.\n if (typeof value == \"object\") {\n // Check for cyclic structures. This is a linear search; performance\n // is inversely proportional to the number of unique nested objects.\n for (length = stack.length; length--;) {\n if (stack[length] === value) {\n // Cyclic structures cannot be serialized by `JSON.stringify`.\n throw TypeError();\n }\n }\n // Add the object to the stack of traversed objects.\n stack.push(value);\n results = [];\n // Save the current indentation level and indent one additional level.\n prefix = indentation;\n indentation += whitespace;\n if (className == arrayClass) {\n // Recursively serialize array elements.\n for (index = 0, length = value.length; index < length; index++) {\n element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n results.push(element === undefined ? \"null\" : element);\n }\n result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n } else {\n // Recursively serialize object members. Members are selected from\n // either a user-specified list of property names, or the object\n // itself.\n forOwn(properties || value, function (property) {\n var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n if (element !== undefined) {\n // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n // is not the empty string, let `member` {quote(property) + \":\"}\n // be the concatenation of `member` and the `space` character.\"\n // The \"`space` character\" refers to the literal space\n // character, not the `space` {width} argument provided to\n // `JSON.stringify`.\n results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n }\n });\n result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n }\n // Remove the object from the traversed object stack.\n stack.pop();\n return result;\n }\n };\n\n // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n exports.stringify = function (source, filter, width) {\n var whitespace, callback, properties, className;\n if (objectTypes[typeof filter] && filter) {\n className = getClass.call(filter);\n if (className == functionClass) {\n callback = filter;\n } else if (className == arrayClass) {\n // Convert the property names array into a makeshift set.\n properties = {};\n for (var index = 0, length = filter.length, value; index < length;) {\n value = filter[index++];\n className = getClass.call(value);\n if (className == \"[object String]\" || className == \"[object Number]\") {\n properties[value] = 1;\n }\n }\n }\n }\n if (width) {\n className = getClass.call(width);\n if (className == numberClass) {\n // Convert the `width` to an integer and create a string containing\n // `width` number of space characters.\n if ((width -= width % 1) > 0) {\n if (width > 10) {\n width = 10;\n }\n for (whitespace = \"\"; whitespace.length < width;) {\n whitespace += \" \";\n }\n }\n } else if (className == stringClass) {\n whitespace = width.length <= 10 ? width : width.slice(0, 10);\n }\n }\n // Opera <= 7.54u2 discards the values associated with empty string keys\n // (`\"\"`) only if they are used directly within an object member list\n // (e.g., `!(\"\" in { \"\": 1})`).\n return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n };\n }\n }\n\n // Public: Parses a JSON source string.\n if (!has(\"json-parse\")) {\n var fromCharCode = String.fromCharCode;\n\n // Internal: A map of escaped control characters and their unescaped\n // equivalents.\n var Unescapes = {\n 92: \"\\\\\",\n 34: '\"',\n 47: \"/\",\n 98: \"\\b\",\n 116: \"\\t\",\n 110: \"\\n\",\n 102: \"\\f\",\n 114: \"\\r\"\n };\n\n // Internal: Stores the parser state.\n var Index, Source;\n\n // Internal: Resets the parser state and throws a `SyntaxError`.\n var abort = function () {\n Index = Source = null;\n throw SyntaxError();\n };\n\n // Internal: Returns the next token, or `\"$\"` if the parser has reached\n // the end of the source string. A token may be a string, number, `null`\n // literal, or Boolean literal.\n var lex = function () {\n var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n while (Index < length) {\n charCode = source.charCodeAt(Index);\n switch (charCode) {\n case 9: case 10: case 13: case 32:\n // Skip whitespace tokens, including tabs, carriage returns, line\n // feeds, and space characters.\n Index++;\n break;\n case 123: case 125: case 91: case 93: case 58: case 44:\n // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n // the current position.\n value = charIndexBuggy ? source.charAt(Index) : source[Index];\n Index++;\n return value;\n case 34:\n // `\"` delimits a JSON string; advance to the next character and\n // begin parsing the string. String tokens are prefixed with the\n // sentinel `@` character to distinguish them from punctuators and\n // end-of-string tokens.\n for (value = \"@\", Index++; Index < length;) {\n charCode = source.charCodeAt(Index);\n if (charCode < 32) {\n // Unescaped ASCII control characters (those with a code unit\n // less than the space character) are not permitted.\n abort();\n } else if (charCode == 92) {\n // A reverse solidus (`\\`) marks the beginning of an escaped\n // control character (including `\"`, `\\`, and `/`) or Unicode\n // escape sequence.\n charCode = source.charCodeAt(++Index);\n switch (charCode) {\n case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n // Revive escaped control characters.\n value += Unescapes[charCode];\n Index++;\n break;\n case 117:\n // `\\u` marks the beginning of a Unicode escape sequence.\n // Advance to the first character and validate the\n // four-digit code point.\n begin = ++Index;\n for (position = Index + 4; Index < position; Index++) {\n charCode = source.charCodeAt(Index);\n // A valid sequence comprises four hexdigits (case-\n // insensitive) that form a single hexadecimal value.\n if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n // Invalid Unicode escape sequence.\n abort();\n }\n }\n // Revive the escaped character.\n value += fromCharCode(\"0x\" + source.slice(begin, Index));\n break;\n default:\n // Invalid escape sequence.\n abort();\n }\n } else {\n if (charCode == 34) {\n // An unescaped double-quote character marks the end of the\n // string.\n break;\n }\n charCode = source.charCodeAt(Index);\n begin = Index;\n // Optimize for the common case where a string is valid.\n while (charCode >= 32 && charCode != 92 && charCode != 34) {\n charCode = source.charCodeAt(++Index);\n }\n // Append the string as-is.\n value += source.slice(begin, Index);\n }\n }\n if (source.charCodeAt(Index) == 34) {\n // Advance to the next character and return the revived string.\n Index++;\n return value;\n }\n // Unterminated string.\n abort();\n default:\n // Parse numbers and literals.\n begin = Index;\n // Advance past the negative sign, if one is specified.\n if (charCode == 45) {\n isSigned = true;\n charCode = source.charCodeAt(++Index);\n }\n // Parse an integer or floating-point value.\n if (charCode >= 48 && charCode <= 57) {\n // Leading zeroes are interpreted as octal literals.\n if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n // Illegal octal literal.\n abort();\n }\n isSigned = false;\n // Parse the integer component.\n for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n // Floats cannot contain a leading decimal point; however, this\n // case is already accounted for by the parser.\n if (source.charCodeAt(Index) == 46) {\n position = ++Index;\n // Parse the decimal component.\n for (; position < length; position++) {\n charCode = source.charCodeAt(position);\n if (charCode < 48 || charCode > 57) {\n break;\n }\n }\n if (position == Index) {\n // Illegal trailing decimal.\n abort();\n }\n Index = position;\n }\n // Parse exponents. The `e` denoting the exponent is\n // case-insensitive.\n charCode = source.charCodeAt(Index);\n if (charCode == 101 || charCode == 69) {\n charCode = source.charCodeAt(++Index);\n // Skip past the sign following the exponent, if one is\n // specified.\n if (charCode == 43 || charCode == 45) {\n Index++;\n }\n // Parse the exponential component.\n for (position = Index; position < length; position++) {\n charCode = source.charCodeAt(position);\n if (charCode < 48 || charCode > 57) {\n break;\n }\n }\n if (position == Index) {\n // Illegal empty exponent.\n abort();\n }\n Index = position;\n }\n // Coerce the parsed value to a JavaScript number.\n return +source.slice(begin, Index);\n }\n // A negative sign may only precede numbers.\n if (isSigned) {\n abort();\n }\n // `true`, `false`, and `null` literals.\n var temp = source.slice(Index, Index + 4);\n if (temp == \"true\") {\n Index += 4;\n return true;\n } else if (temp == \"fals\" && source.charCodeAt(Index + 4 ) == 101) {\n Index += 5;\n return false;\n } else if (temp == \"null\") {\n Index += 4;\n return null;\n }\n // Unrecognized token.\n abort();\n }\n }\n // Return the sentinel `$` character if the parser has reached the end\n // of the source string.\n return \"$\";\n };\n\n // Internal: Parses a JSON `value` token.\n var get = function (value) {\n var results, hasMembers;\n if (value == \"$\") {\n // Unexpected end of input.\n abort();\n }\n if (typeof value == \"string\") {\n if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n // Remove the sentinel `@` character.\n return value.slice(1);\n }\n // Parse object and array literals.\n if (value == \"[\") {\n // Parses a JSON array, returning a new JavaScript array.\n results = [];\n for (;;) {\n value = lex();\n // A closing square bracket marks the end of the array literal.\n if (value == \"]\") {\n break;\n }\n // If the array literal contains elements, the current token\n // should be a comma separating the previous element from the\n // next.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"]\") {\n // Unexpected trailing `,` in array literal.\n abort();\n }\n } else {\n // A `,` must separate each array element.\n abort();\n }\n } else {\n hasMembers = true;\n }\n // Elisions and leading commas are not permitted.\n if (value == \",\") {\n abort();\n }\n results.push(get(value));\n }\n return results;\n } else if (value == \"{\") {\n // Parses a JSON object, returning a new JavaScript object.\n results = {};\n for (;;) {\n value = lex();\n // A closing curly brace marks the end of the object literal.\n if (value == \"}\") {\n break;\n }\n // If the object literal contains members, the current token\n // should be a comma separator.\n if (hasMembers) {\n if (value == \",\") {\n value = lex();\n if (value == \"}\") {\n // Unexpected trailing `,` in object literal.\n abort();\n }\n } else {\n // A `,` must separate each object member.\n abort();\n }\n } else {\n hasMembers = true;\n }\n // Leading commas are not permitted, object property names must be\n // double-quoted strings, and a `:` must separate each property\n // name and value.\n if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n abort();\n }\n results[value.slice(1)] = get(lex());\n }\n return results;\n }\n // Unexpected token encountered.\n abort();\n }\n return value;\n };\n\n // Internal: Updates a traversed object member.\n var update = function (source, property, callback) {\n var element = walk(source, property, callback);\n if (element === undefined) {\n delete source[property];\n } else {\n source[property] = element;\n }\n };\n\n // Internal: Recursively traverses a parsed JSON object, invoking the\n // `callback` function for each value. This is an implementation of the\n // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n var walk = function (source, property, callback) {\n var value = source[property], length;\n if (typeof value == \"object\" && value) {\n // `forOwn` can't be used to traverse an array in Opera <= 8.54\n // because its `Object#hasOwnProperty` implementation returns `false`\n // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n if (getClass.call(value) == arrayClass) {\n for (length = value.length; length--;) {\n update(getClass, forOwn, value, length, callback);\n }\n } else {\n forOwn(value, function (property) {\n update(value, property, callback);\n });\n }\n }\n return callback.call(source, property, value);\n };\n\n // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n exports.parse = function (source, callback) {\n var result, value;\n Index = 0;\n Source = \"\" + source;\n result = get(lex());\n // If a JSON string contains multiple tokens, it is invalid.\n if (lex() != \"$\") {\n abort();\n }\n // Reset the parser state.\n Index = Source = null;\n return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n };\n }\n }\n\n exports.runInContext = runInContext;\n return exports;\n }\n\n if (freeExports && !isLoader) {\n // Export for CommonJS environments.\n runInContext(root, freeExports);\n } else {\n // Export for web browsers and JavaScript engines.\n var nativeJSON = root.JSON,\n previousJSON = root.JSON3,\n isRestored = false;\n\n var JSON3 = runInContext(root, (root.JSON3 = {\n // Public: Restores the original value of the global `JSON` object and\n // returns a reference to the `JSON3` object.\n \"noConflict\": function () {\n if (!isRestored) {\n isRestored = true;\n root.JSON = nativeJSON;\n root.JSON3 = previousJSON;\n nativeJSON = previousJSON = null;\n }\n return JSON3;\n }\n }));\n\n root.JSON = {\n \"parse\": JSON3.parse,\n \"stringify\": JSON3.stringify\n };\n }\n\n // Export for asynchronous module loaders.\n if (isLoader) {\n define(function () {\n return JSON3;\n });\n }\n}).call(this);\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 * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options){\n options = options || {};\n if ('string' == typeof val) return parse(val);\n return options.long\n ? long(val)\n : short(val);\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 = '' + str;\n if (str.length > 10000) return;\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n if (!match) return;\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 }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction short(ms) {\n if (ms >= d) return Math.round(ms / d) + 'd';\n if (ms >= h) return Math.round(ms / h) + 'h';\n if (ms >= m) return Math.round(ms / m) + 'm';\n if (ms >= s) return Math.round(ms / s) + 's';\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 long(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) return;\n if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\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 = debug;\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, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % 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 debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\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 // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\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 = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-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 if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\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 var split = (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/**\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 // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\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 return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\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 args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\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-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 return args;\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 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 clone from \"@ndhoule/clone\";\nimport cookie from \"rudder-component-cookie\";\nimport defaults from \"@ndhoule/defaults\";\nimport json from \"json3\";\nimport topDomain from \"@segment/top-domain\";\nimport logger from \"../logUtil\";\n\n/**\n * An object utility to persist values in cookies\n */\nclass CookieLocal {\n constructor(options) {\n this._options = {};\n this.options(options);\n }\n\n /**\n *\n * @param {*} options\n */\n options(options = {}) {\n if (arguments.length === 0) return this._options;\n\n let domain = `.${topDomain(window.location.href)}`;\n if (domain === \".\") domain = null;\n\n // the default maxage and path\n this._options = defaults(options, {\n maxage: 31536000000,\n path: \"/\",\n domain,\n samesite: \"Lax\",\n });\n\n // try setting a cookie first\n this.set(\"test_rudder\", true);\n if (!this.get(\"test_rudder\")) {\n this._options.domain = null;\n }\n this.remove(\"test_rudder\");\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n set(key, value) {\n try {\n cookie(key, value, clone(this._options));\n return true;\n } catch (e) {\n logger.error(e);\n return false;\n }\n }\n\n /**\n *\n * @param {*} key\n */\n get(key) {\n return cookie(key);\n }\n\n /**\n *\n * @param {*} key\n */\n remove(key) {\n try {\n cookie(key, null, clone(this._options));\n return true;\n } catch (e) {\n return false;\n }\n }\n}\n\n// Exporting only the instance\nconst Cookie = new CookieLocal({});\n\nexport { Cookie };\n","\"use strict\"\n\nvar JSON = require('json3');\n\nmodule.exports = (function() {\n\t// Store.js\n\tvar store = {},\n\t\twin = (typeof window != 'undefined' ? window : global),\n\t\tdoc = win.document,\n\t\tlocalStorageName = 'localStorage',\n\t\tscriptTag = 'script',\n\t\tstorage\n\n\tstore.disabled = false\n\tstore.version = '1.3.20'\n\tstore.set = function(key, value) {}\n\tstore.get = function(key, defaultVal) {}\n\tstore.has = function(key) { return store.get(key) !== undefined }\n\tstore.remove = function(key) {}\n\tstore.clear = function() {}\n\tstore.transact = function(key, defaultVal, transactionFn) {\n\t\tif (transactionFn == null) {\n\t\t\ttransactionFn = defaultVal\n\t\t\tdefaultVal = null\n\t\t}\n\t\tif (defaultVal == null) {\n\t\t\tdefaultVal = {}\n\t\t}\n\t\tvar val = store.get(key, defaultVal)\n\t\ttransactionFn(val)\n\t\tstore.set(key, val)\n\t}\n\tstore.getAll = function() {\n\t\tvar ret = {}\n\t\tstore.forEach(function(key, val) {\n\t\t\tret[key] = val\n\t\t})\n\t\treturn ret\n\t}\n\tstore.forEach = function() {}\n\tstore.serialize = function(value) {\n\t\treturn JSON.stringify(value)\n\t}\n\tstore.deserialize = function(value) {\n\t\tif (typeof value != 'string') { return undefined }\n\t\ttry { return JSON.parse(value) }\n\t\tcatch(e) { return value || undefined }\n\t}\n\n\t// Functions to encapsulate questionable FireFox 3.6.13 behavior\n\t// when about.config::dom.storage.enabled === false\n\t// See https://github.com/marcuswestin/store.js/issues#issue/13\n\tfunction isLocalStorageNameSupported() {\n\t\ttry { return (localStorageName in win && win[localStorageName]) }\n\t\tcatch(err) { return false }\n\t}\n\n\tif (isLocalStorageNameSupported()) {\n\t\tstorage = win[localStorageName]\n\t\tstore.set = function(key, val) {\n\t\t\tif (val === undefined) { return store.remove(key) }\n\t\t\tstorage.setItem(key, store.serialize(val))\n\t\t\treturn val\n\t\t}\n\t\tstore.get = function(key, defaultVal) {\n\t\t\tvar val = store.deserialize(storage.getItem(key))\n\t\t\treturn (val === undefined ? defaultVal : val)\n\t\t}\n\t\tstore.remove = function(key) { storage.removeItem(key) }\n\t\tstore.clear = function() { storage.clear() }\n\t\tstore.forEach = function(callback) {\n\t\t\tfor (var i=0; idocument.w=window')\n\t\t\tstorageContainer.close()\n\t\t\tstorageOwner = storageContainer.w.frames[0].document\n\t\t\tstorage = storageOwner.createElement('div')\n\t\t} catch(e) {\n\t\t\t// somehow ActiveXObject instantiation failed (perhaps some special\n\t\t\t// security settings or otherwse), fall back to per-path storage\n\t\t\tstorage = doc.createElement('div')\n\t\t\tstorageOwner = doc.body\n\t\t}\n\t\tvar withIEStorage = function(storeFunction) {\n\t\t\treturn function() {\n\t\t\t\tvar args = Array.prototype.slice.call(arguments, 0)\n\t\t\t\targs.unshift(storage)\n\t\t\t\t// See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx\n\t\t\t\t// and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx\n\t\t\t\tstorageOwner.appendChild(storage)\n\t\t\t\tstorage.addBehavior('#default#userData')\n\t\t\t\tstorage.load(localStorageName)\n\t\t\t\tvar result = storeFunction.apply(store, args)\n\t\t\t\tstorageOwner.removeChild(storage)\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\n\t\t// In IE7, keys cannot start with a digit or contain certain chars.\n\t\t// See https://github.com/marcuswestin/store.js/issues/40\n\t\t// See https://github.com/marcuswestin/store.js/issues/83\n\t\tvar forbiddenCharsRegex = new RegExp(\"[!\\\"#$%&'()*+,/\\\\\\\\:;<=>?@[\\\\]^`{|}~]\", \"g\")\n\t\tvar ieKeyFix = function(key) {\n\t\t\treturn key.replace(/^d/, '___$&').replace(forbiddenCharsRegex, '___')\n\t\t}\n\t\tstore.set = withIEStorage(function(storage, key, val) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tif (val === undefined) { return store.remove(key) }\n\t\t\tstorage.setAttribute(key, store.serialize(val))\n\t\t\tstorage.save(localStorageName)\n\t\t\treturn val\n\t\t})\n\t\tstore.get = withIEStorage(function(storage, key, defaultVal) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tvar val = store.deserialize(storage.getAttribute(key))\n\t\t\treturn (val === undefined ? defaultVal : val)\n\t\t})\n\t\tstore.remove = withIEStorage(function(storage, key) {\n\t\t\tkey = ieKeyFix(key)\n\t\t\tstorage.removeAttribute(key)\n\t\t\tstorage.save(localStorageName)\n\t\t})\n\t\tstore.clear = withIEStorage(function(storage) {\n\t\t\tvar attributes = storage.XMLDocument.documentElement.attributes\n\t\t\tstorage.load(localStorageName)\n\t\t\tfor (var i=attributes.length-1; i>=0; i--) {\n\t\t\t\tstorage.removeAttribute(attributes[i].name)\n\t\t\t}\n\t\t\tstorage.save(localStorageName)\n\t\t})\n\t\tstore.forEach = withIEStorage(function(storage, callback) {\n\t\t\tvar attributes = storage.XMLDocument.documentElement.attributes\n\t\t\tfor (var i=0, attr; attr=attributes[i]; ++i) {\n\t\t\t\tcallback(attr.name, store.deserialize(storage.getAttribute(attr.name)))\n\t\t\t}\n\t\t})\n\t}\n\n\ttry {\n\t\tvar testKey = '__storejs__'\n\t\tstore.set(testKey, testKey)\n\t\tif (store.get(testKey) != testKey) { store.disabled = true }\n\t\tstore.remove(testKey)\n\t} catch(e) {\n\t\tstore.disabled = true\n\t}\n\tstore.enabled = !store.disabled\n\t\n\treturn store\n}())\n","import defaults from \"@ndhoule/defaults\";\nimport store from \"@segment/store\";\n\n/**\n * An object utility to persist user and other values in localstorage\n */\nclass StoreLocal {\n constructor(options) {\n this._options = {};\n this.enabled = false;\n this.options(options);\n }\n\n /**\n *\n * @param {*} options\n */\n options(options = {}) {\n if (arguments.length === 0) return this._options;\n\n defaults(options, { enabled: true });\n\n this.enabled = options.enabled && store.enabled;\n this._options = options;\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n set(key, value) {\n if (!this.enabled) return false;\n return store.set(key, value);\n }\n\n /**\n *\n * @param {*} key\n */\n get(key) {\n if (!this.enabled) return null;\n return store.get(key);\n }\n\n /**\n *\n * @param {*} key\n */\n remove(key) {\n if (!this.enabled) return false;\n return store.remove(key);\n }\n}\n\n// Exporting only the instance\nconst Store = new StoreLocal({});\n\nexport { Store };\n","import AES from \"crypto-js/aes\";\nimport Utf8 from \"crypto-js/enc-utf8\";\nimport logger from \"../logUtil\";\nimport { Cookie } from \"./cookie\";\nimport { Store } from \"./store\";\n\nconst defaults = {\n user_storage_key: \"rl_user_id\",\n user_storage_trait: \"rl_trait\",\n user_storage_anonymousId: \"rl_anonymous_id\",\n group_storage_key: \"rl_group_id\",\n group_storage_trait: \"rl_group_trait\",\n prefix: \"RudderEncrypt:\",\n key: \"Rudder\",\n};\n\n/**\n * An object that handles persisting key-val from Analytics\n */\nclass Storage {\n constructor() {\n // First try setting the storage to cookie else to localstorage\n Cookie.set(\"rudder_cookies\", true);\n\n if (Cookie.get(\"rudder_cookies\")) {\n Cookie.remove(\"rudder_cookies\");\n this.storage = Cookie;\n return;\n }\n\n // localStorage is enabled.\n if (Store.enabled) {\n this.storage = Store;\n }\n }\n\n /**\n * Json stringify the given value\n * @param {*} value\n */\n stringify(value) {\n return JSON.stringify(value);\n }\n\n /**\n * JSON parse the value\n * @param {*} value\n */\n parse(value) {\n // if not parseable, return as is without json parse\n try {\n return value ? JSON.parse(value) : null;\n } catch (e) {\n logger.error(e);\n return value || null;\n }\n }\n\n /**\n * trim using regex for browser polyfill\n * @param {*} value\n */\n trim(value) {\n return value.replace(/^\\s+|\\s+$/gm, \"\");\n }\n\n /**\n * AES encrypt value with constant prefix\n * @param {*} value\n */\n encryptValue(value) {\n if (this.trim(value) == \"\") {\n return value;\n }\n const prefixedVal = `${defaults.prefix}${AES.encrypt(\n value,\n defaults.key\n ).toString()}`;\n\n return prefixedVal;\n }\n\n /**\n * decrypt value\n * @param {*} value\n */\n decryptValue(value) {\n if (!value || (typeof value === \"string\" && this.trim(value) == \"\")) {\n return value;\n }\n if (value.substring(0, defaults.prefix.length) == defaults.prefix) {\n return AES.decrypt(\n value.substring(defaults.prefix.length),\n defaults.key\n ).toString(Utf8);\n }\n return value;\n }\n\n /**\n *\n * @param {*} key\n * @param {*} value\n */\n setItem(key, value) {\n this.storage.set(key, this.encryptValue(this.stringify(value)));\n }\n\n /**\n *\n * @param {*} value\n */\n setUserId(value) {\n if (typeof value !== \"string\") {\n logger.error(\"[Storage] setUserId:: userId should be string\");\n return;\n }\n this.storage.set(\n defaults.user_storage_key,\n this.encryptValue(this.stringify(value))\n );\n }\n\n /**\n *\n * @param {*} value\n */\n setUserTraits(value) {\n this.storage.set(\n defaults.user_storage_trait,\n this.encryptValue(this.stringify(value))\n );\n }\n\n /**\n *\n * @param {*} value\n */\n setGroupId(value) {\n if (typeof value !== \"string\") {\n logger.error(\"[Storage] setGroupId:: groupId should be string\");\n return;\n }\n this.storage.set(\n defaults.group_storage_key,\n this.encryptValue(this.stringify(value))\n );\n }\n\n /**\n *\n * @param {*} value\n */\n setGroupTraits(value) {\n this.storage.set(\n defaults.group_storage_trait,\n this.encryptValue(this.stringify(value))\n );\n }\n\n /**\n *\n * @param {*} value\n */\n setAnonymousId(value) {\n if (typeof value !== \"string\") {\n logger.error(\"[Storage] setAnonymousId:: anonymousId should be string\");\n return;\n }\n this.storage.set(\n defaults.user_storage_anonymousId,\n this.encryptValue(this.stringify(value))\n );\n }\n\n /**\n *\n * @param {*} key\n */\n getItem(key) {\n return this.parse(this.decryptValue(this.storage.get(key)));\n }\n\n /**\n * get the stored userId\n */\n getUserId() {\n return this.parse(\n this.decryptValue(this.storage.get(defaults.user_storage_key))\n );\n }\n\n /**\n * get the stored user traits\n */\n getUserTraits() {\n return this.parse(\n this.decryptValue(this.storage.get(defaults.user_storage_trait))\n );\n }\n\n /**\n * get the stored userId\n */\n getGroupId() {\n return this.parse(\n this.decryptValue(this.storage.get(defaults.group_storage_key))\n );\n }\n\n /**\n * get the stored user traits\n */\n getGroupTraits() {\n return this.parse(\n this.decryptValue(this.storage.get(defaults.group_storage_trait))\n );\n }\n\n /**\n * get stored anonymous id\n */\n getAnonymousId() {\n return this.parse(\n this.decryptValue(this.storage.get(defaults.user_storage_anonymousId))\n );\n }\n\n /**\n *\n * @param {*} key\n */\n removeItem(key) {\n return this.storage.remove(key);\n }\n\n /**\n * remove stored keys\n */\n clear() {\n this.storage.remove(defaults.user_storage_key);\n this.storage.remove(defaults.user_storage_trait);\n this.storage.remove(defaults.group_storage_key);\n this.storage.remove(defaults.group_storage_trait);\n // this.storage.remove(defaults.user_storage_anonymousId);\n }\n}\n\nexport { Storage };\n","import { Storage } from \"./storage\";\n\nexport default new Storage();\n","import logger from \"../../utils/logUtil\";\nimport Storage from \"../../utils/storage\";\n\nconst defaults = {\n lotame_synch_time_key: \"lt_synch_timestamp\",\n};\n\nclass LotameStorage {\n constructor() {\n this.storage = Storage; // new Storage();\n }\n\n setLotameSynchTime(value) {\n this.storage.setItem(defaults.lotame_synch_time_key, value);\n }\n\n getLotameSynchTime() {\n return this.storage.getItem(defaults.lotame_synch_time_key);\n }\n}\nconst lotameStorage = new LotameStorage();\nexport { lotameStorage as LotameStorage };\n","import logger from \"../../utils/logUtil\";\nimport { LotameStorage } from \"./LotameStorage\";\n\nclass Lotame {\n constructor(config, analytics) {\n this.name = \"LOTAME\";\n this.analytics = analytics;\n this.storage = LotameStorage;\n this.bcpUrlSettingsPixel = config.bcpUrlSettingsPixel;\n this.bcpUrlSettingsIframe = config.bcpUrlSettingsIframe;\n this.dspUrlSettingsPixel = config.dspUrlSettingsPixel;\n this.dspUrlSettingsIframe = config.dspUrlSettingsIframe;\n this.mappings = {};\n config.mappings.forEach((mapping) => {\n const { key } = mapping;\n const { value } = mapping;\n this.mappings[key] = value;\n });\n }\n\n init() {\n logger.debug(\"===in init Lotame===\");\n window.LOTAME_SYNCH_CALLBACK = () => {};\n }\n\n addPixel(source, width, height) {\n logger.debug(`Adding pixel for :: ${source}`);\n\n const image = document.createElement(\"img\");\n image.src = source;\n image.setAttribute(\"width\", width);\n image.setAttribute(\"height\", height);\n\n logger.debug(`Image Pixel :: ${image}`);\n document.getElementsByTagName(\"body\")[0].appendChild(image);\n }\n\n addIFrame(source) {\n logger.debug(`Adding iframe for :: ${source}`);\n\n const iframe = document.createElement(\"iframe\");\n iframe.src = source;\n iframe.title = \"empty\";\n iframe.setAttribute(\"id\", \"LOTCCFrame\");\n iframe.setAttribute(\"tabindex\", \"-1\");\n iframe.setAttribute(\"role\", \"presentation\");\n iframe.setAttribute(\"aria-hidden\", \"true\");\n iframe.setAttribute(\n \"style\",\n \"border: 0px; width: 0px; height: 0px; display: block;\"\n );\n\n logger.debug(`IFrame :: ${iframe}`);\n document.getElementsByTagName(\"body\")[0].appendChild(iframe);\n }\n\n syncPixel(userId) {\n logger.debug(\"===== in syncPixel ======\");\n\n logger.debug(\"Firing DSP Pixel URLs\");\n if (this.dspUrlSettingsPixel && this.dspUrlSettingsPixel.length > 0) {\n const currentTime = Date.now();\n this.dspUrlSettingsPixel.forEach((urlSettings) => {\n const dspUrl = this.compileUrl(\n { ...this.mappings, userId, random: currentTime },\n urlSettings.dspUrlTemplate\n );\n this.addPixel(dspUrl, \"1\", \"1\");\n });\n }\n\n logger.debug(\"Firing DSP IFrame URLs\");\n if (this.dspUrlSettingsIframe && this.dspUrlSettingsIframe.length > 0) {\n const currentTime = Date.now();\n this.dspUrlSettingsIframe.forEach((urlSettings) => {\n const dspUrl = this.compileUrl(\n { ...this.mappings, userId, random: currentTime },\n urlSettings.dspUrlTemplate\n );\n this.addIFrame(dspUrl);\n });\n }\n\n this.storage.setLotameSynchTime(Date.now());\n // emit on syncPixel\n if (this.analytics.methodToCallbackMapping.syncPixel) {\n this.analytics.emit(\"syncPixel\", {\n destination: this.name,\n });\n }\n }\n\n compileUrl(map, url) {\n Object.keys(map).forEach((key) => {\n if (map.hasOwnProperty(key)) {\n const replaceKey = `{{${key}}}`;\n const regex = new RegExp(replaceKey, \"gi\");\n url = url.replace(regex, map[key]);\n }\n });\n return url;\n }\n\n identify(rudderElement) {\n logger.debug(\"in Lotame identify\");\n const { userId } = rudderElement.message;\n this.syncPixel(userId);\n }\n\n track(rudderElement) {\n logger.debug(\"track not supported for lotame\");\n }\n\n page(rudderElement) {\n logger.debug(\"in Lotame page\");\n\n logger.debug(\"Firing BCP Pixel URLs\");\n if (this.bcpUrlSettingsPixel && this.bcpUrlSettingsPixel.length > 0) {\n const currentTime = Date.now();\n this.bcpUrlSettingsPixel.forEach((urlSettings) => {\n const bcpUrl = this.compileUrl(\n { ...this.mappings, random: currentTime },\n urlSettings.bcpUrlTemplate\n );\n this.addPixel(bcpUrl, \"1\", \"1\");\n });\n }\n\n logger.debug(\"Firing BCP IFrame URLs\");\n if (this.bcpUrlSettingsIframe && this.bcpUrlSettingsIframe.length > 0) {\n const currentTime = Date.now();\n this.bcpUrlSettingsIframe.forEach((urlSettings) => {\n const bcpUrl = this.compileUrl(\n { ...this.mappings, random: currentTime },\n urlSettings.bcpUrlTemplate\n );\n this.addIFrame(bcpUrl);\n });\n }\n\n if (rudderElement.message.userId && this.isPixelToBeSynched()) {\n this.syncPixel(rudderElement.message.userId);\n }\n }\n\n isPixelToBeSynched() {\n const lastSynchedTime = this.storage.getLotameSynchTime();\n const currentTime = Date.now();\n if (!lastSynchedTime) {\n return true;\n }\n\n const difference = Math.floor(\n (currentTime - lastSynchedTime) / (1000 * 3600 * 24)\n );\n return difference >= 7;\n }\n\n isLoaded() {\n logger.debug(\"in Lotame isLoaded\");\n return true;\n }\n\n isReady() {\n return true;\n }\n}\n\nexport { Lotame };\n","/* eslint-disable no-param-reassign */\n/* eslint-disable class-methods-use-this */\nimport logger from \"../../utils/logUtil\";\n\nclass Optimizely {\n constructor(config, analytics) {\n this.analytics = analytics;\n this.sendExperimentTrack = config.sendExperimentTrack;\n this.sendExperimentIdentify = config.sendExperimentIdentify;\n this.sendExperimentTrackAsNonInteractive =\n config.sendExperimentTrackAsNonInteractive;\n this.revenueOnlyOnOrderCompleted = config.revenueOnlyOnOrderCompleted;\n this.trackCategorizedPages = config.trackCategorizedPages;\n this.trackNamedPages = config.trackNamedPages;\n this.customCampaignProperties = config.customCampaignProperties\n ? config.customCampaignProperties\n : [];\n this.customExperimentProperties = config.customExperimentProperties\n ? config.customExperimentProperties\n : [];\n this.name = \"OPTIMIZELY\";\n }\n\n init() {\n logger.debug(\"=== in optimizely init ===\");\n this.initOptimizelyIntegration(\n this.referrerOverride,\n this.sendDataToRudder\n );\n }\n\n referrerOverride = (referrer) => {\n if (referrer) {\n window.optimizelyEffectiveReferrer = referrer;\n return referrer;\n }\n return undefined;\n };\n\n sendDataToRudder = (campaignState) => {\n logger.debug(campaignState);\n const { experiment } = campaignState;\n const { variation } = campaignState;\n const context = { integrations: { All: true } };\n const { audiences } = campaignState;\n\n // Reformatting this data structure into hash map so concatenating variation ids and names is easier later\n const audiencesMap = {};\n audiences.forEach((audience) => {\n audiencesMap[audience.id] = audience.name;\n });\n\n const audienceIds = Object.keys(audiencesMap).sort().join();\n const audienceNames = Object.values(audiencesMap).sort().join(\", \");\n\n if (this.sendExperimentTrack) {\n const props = {\n campaignName: campaignState.campaignName,\n campaignId: campaignState.id,\n experimentId: experiment.id,\n experimentName: experiment.name,\n variationName: variation.name,\n variationId: variation.id,\n audienceId: audienceIds, // eg. '7527562222,7527111138'\n audienceName: audienceNames, // eg. 'Peaky Blinders, Trust Tree'\n isInCampaignHoldback: campaignState.isInCampaignHoldback,\n };\n\n // If this was a redirect experiment and the effective referrer is different from document.referrer,\n // this value is made available. So if a customer came in via google.com/ad -> tb12.com -> redirect experiment -> Belichickgoat.com\n // `experiment.referrer` would be google.com/ad here NOT `tb12.com`.\n if (experiment.referrer) {\n props.referrer = experiment.referrer;\n context.page = { referrer: experiment.referrer };\n }\n\n // For Google's nonInteraction flag\n if (this.sendExperimentTrackAsNonInteractive) props.nonInteraction = 1;\n\n // If customCampaignProperties is provided overide the props with it.\n // If valid customCampaignProperties present it will override existing props.\n // const data = window.optimizely && window.optimizely.get(\"data\");\n const data = campaignState;\n if (data && this.customCampaignProperties.length > 0) {\n for (\n let index = 0;\n index < this.customCampaignProperties.length;\n index += 1\n ) {\n const rudderProp = this.customCampaignProperties[index].from;\n const optimizelyProp = this.customCampaignProperties[index].to;\n if (typeof props[optimizelyProp] !== \"undefined\") {\n props[rudderProp] = props[optimizelyProp];\n delete props[optimizelyProp];\n }\n }\n }\n\n // Send to Rudder\n this.analytics.track(\"Experiment Viewed\", props, context);\n }\n if (this.sendExperimentIdentify) {\n const traits = {};\n traits[`Experiment: ${experiment.name}`] = variation.name;\n\n // Send to Rudder\n this.analytics.identify(traits);\n }\n };\n\n initOptimizelyIntegration(referrerOverride, sendCampaignData) {\n const newActiveCampaign = (id, referrer) => {\n const state = window.optimizely.get && window.optimizely.get(\"state\");\n if (state) {\n const activeCampaigns = state.getCampaignStates({\n isActive: true,\n });\n const campaignState = activeCampaigns[id];\n if (referrer) campaignState.experiment.referrer = referrer;\n sendCampaignData(campaignState);\n }\n };\n\n const checkReferrer = () => {\n const state = window.optimizely.get && window.optimizely.get(\"state\");\n if (state) {\n const referrer =\n state.getRedirectInfo() && state.getRedirectInfo().referrer;\n\n if (referrer) {\n referrerOverride(referrer);\n return referrer;\n }\n }\n return undefined;\n };\n\n const registerFutureActiveCampaigns = () => {\n window.optimizely = window.optimizely || [];\n window.optimizely.push({\n type: \"addListener\",\n filter: {\n type: \"lifecycle\",\n name: \"campaignDecided\",\n },\n handler(event) {\n const { id } = event.data.campaign;\n newActiveCampaign(id);\n },\n });\n };\n\n const registerCurrentlyActiveCampaigns = () => {\n window.optimizely = window.optimizely || [];\n const state = window.optimizely.get && window.optimizely.get(\"state\");\n if (state) {\n const referrer = checkReferrer();\n const activeCampaigns = state.getCampaignStates({\n isActive: true,\n });\n Object.keys(activeCampaigns).forEach((id) => {\n if (referrer) {\n newActiveCampaign(id, referrer);\n } else {\n newActiveCampaign(id);\n }\n });\n } else {\n window.optimizely.push({\n type: \"addListener\",\n filter: {\n type: \"lifecycle\",\n name: \"initialized\",\n },\n handler() {\n checkReferrer();\n },\n });\n }\n };\n registerCurrentlyActiveCampaigns();\n registerFutureActiveCampaigns();\n }\n\n track(rudderElement) {\n logger.debug(\"in Optimizely web track\");\n const eventProperties = rudderElement.message.properties;\n const { event } = rudderElement.message;\n if (eventProperties.revenue && this.revenueOnlyOnOrderCompleted) {\n if (event === \"Order Completed\") {\n eventProperties.revenue = Math.round(eventProperties.revenue * 100);\n } else if (event !== \"Order Completed\") {\n delete eventProperties.revenue;\n }\n }\n const eventName = event.replace(/:/g, \"_\"); // can't have colons so replacing with underscores\n const payload = {\n type: \"event\",\n eventName,\n tags: eventProperties,\n };\n\n window.optimizely.push(payload);\n }\n\n page(rudderElement) {\n logger.debug(\"in Optimizely web page\");\n const { category } = rudderElement.message.properties;\n const { name } = rudderElement.message;\n /* const contextOptimizely = {\n integrations: { All: false, Optimizely: true },\n }; */\n\n // categorized pages\n if (category && this.trackCategorizedPages) {\n // this.analytics.track(`Viewed ${category} page`, {}, contextOptimizely);\n rudderElement.message.event = `Viewed ${category} page`;\n rudderElement.message.type = \"track\";\n this.track(rudderElement);\n }\n\n // named pages\n if (name && this.trackNamedPages) {\n // this.analytics.track(`Viewed ${name} page`, {}, contextOptimizely);\n rudderElement.message.event = `Viewed ${name} page`;\n rudderElement.message.type = \"track\";\n this.track(rudderElement);\n }\n }\n\n isLoaded() {\n return !!(\n window.optimizely && window.optimizely.push !== Array.prototype.push\n );\n }\n\n isReady() {\n return !!(\n window.optimizely && window.optimizely.push !== Array.prototype.push\n );\n }\n}\n\nexport default Optimizely;\n","import logger from \"../../utils/logUtil\";\nimport ScriptLoader from \"../ScriptLoader\";\n\nclass Bugsnag {\n constructor(config) {\n this.releaseStage = config.releaseStage;\n this.apiKey = config.apiKey;\n this.name = \"BUGSNAG\";\n this.setIntervalHandler = undefined;\n }\n\n init() {\n logger.debug(\"===in init Bugsnag===\");\n ScriptLoader(\n \"bugsnag-id\",\n \"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js\"\n );\n\n this.setIntervalHandler = setInterval(\n this.initBugsnagClient.bind(this),\n 1000\n );\n }\n\n initBugsnagClient() {\n if (window.bugsnag !== undefined) {\n window.bugsnagClient = window.bugsnag(this.apiKey);\n window.bugsnagClient.releaseStage = this.releaseStage;\n clearInterval(this.setIntervalHandler);\n }\n }\n\n isLoaded() {\n logger.debug(\"in bugsnag isLoaded\");\n return !!window.bugsnagClient;\n }\n\n isReady() {\n logger.debug(\"in bugsnag isReady\");\n return !!window.bugsnagClient;\n }\n\n identify(rudderElement) {\n const { traits } = rudderElement.message.context;\n const traitsFinal = {\n id: rudderElement.message.userId || rudderElement.message.anonymousId,\n name: traits.name,\n email: traits.email,\n };\n\n window.bugsnagClient.user = traitsFinal;\n window.bugsnagClient.notify(new Error(\"error in identify\"));\n }\n}\nexport { Bugsnag };\n","'use strict';\n\nconst preserveCamelCase = string => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\n\tfor (let i = 0; i < string.length; i++) {\n\t\tconst character = string[i];\n\n\t\tif (isLastCharLower && /[\\p{Lu}]/u.test(character)) {\n\t\t\tstring = string.slice(0, i) + '-' + string.slice(i);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\ti++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && /[\\p{Ll}]/u.test(character)) {\n\t\t\tstring = string.slice(0, i - 1) + '-' + string.slice(i - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = character.toLocaleLowerCase() === character && character.toLocaleUpperCase() !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = character.toLocaleUpperCase() === character && character.toLocaleLowerCase() !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst camelCase = (input, options) => {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = {\n\t\t...{pascalCase: false},\n\t\t...options\n\t};\n\n\tconst postProcess = x => options.pascalCase ? x.charAt(0).toLocaleUpperCase() + x.slice(1) : x;\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tif (input.length === 1) {\n\t\treturn options.pascalCase ? input.toLocaleUpperCase() : input.toLocaleLowerCase();\n\t}\n\n\tconst hasUpperCase = input !== input.toLocaleLowerCase();\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input);\n\t}\n\n\tinput = input\n\t\t.replace(/^[_.\\- ]+/, '')\n\t\t.toLocaleLowerCase()\n\t\t.replace(/[_.\\- ]+([\\p{Alpha}\\p{N}_]|$)/gu, (_, p1) => p1.toLocaleUpperCase())\n\t\t.replace(/\\d+([\\p{Alpha}\\p{N}_]|$)/gu, m => m.toLocaleUpperCase());\n\n\treturn postProcess(input);\n};\n\nmodule.exports = camelCase;\n// TODO: Remove this for the next major release\nmodule.exports.default = camelCase;\n","import camelcase from \"camelcase\";\nimport logger from \"../../utils/logUtil\";\n\nclass Fullstory {\n constructor(config) {\n this.fs_org = config.fs_org;\n this.fs_debug_mode = config.fs_debug_mode;\n this.name = \"FULLSTORY\";\n }\n\n static getFSProperties(properties) {\n const FS_properties = {};\n Object.keys(properties).map(function (key, index) {\n FS_properties[\n key === \"displayName\" || key === \"email\"\n ? key\n : Fullstory.camelCaseField(key)\n ] = properties[key];\n });\n return FS_properties;\n }\n\n static camelCaseField(fieldName) {\n // Do not camel case across type suffixes.\n const parts = fieldName.split(\"_\");\n if (parts.length > 1) {\n const typeSuffix = parts.pop();\n switch (typeSuffix) {\n case \"str\":\n case \"int\":\n case \"date\":\n case \"real\":\n case \"bool\":\n case \"strs\":\n case \"ints\":\n case \"dates\":\n case \"reals\":\n case \"bools\":\n return `${camelcase(parts.join(\"_\"))}_${typeSuffix}`;\n default: // passthrough\n }\n }\n // No type suffix found. Camel case the whole field name.\n return camelcase(fieldName);\n }\n\n init() {\n logger.debug(\"===in init FULLSTORY===\");\n\n window._fs_debug = this.fs_debug_mode;\n window._fs_host = \"fullstory.com\";\n window._fs_script = \"edge.fullstory.com/s/fs.js\";\n window._fs_org = this.fs_org;\n window._fs_namespace = \"FS\";\n (function (m, n, e, t, l, o, g, y) {\n if (e in m) {\n if (m.console && m.console.log) {\n m.console.log(\n 'FullStory namespace conflict. Please set window[\"_fs_namespace\"].'\n );\n }\n return;\n }\n g = m[e] = function (a, b, s) {\n g.q ? g.q.push([a, b, s]) : g._api(a, b, s);\n };\n g.q = [];\n o = n.createElement(t);\n o.async = 1;\n o.crossOrigin = \"anonymous\";\n o.src = `https://${_fs_script}`;\n y = n.getElementsByTagName(t)[0];\n y.parentNode.insertBefore(o, y);\n g.identify = function (i, v, s) {\n g(l, { uid: i }, s);\n if (v) g(l, v, s);\n };\n g.setUserVars = function (v, s) {\n g(l, v, s);\n };\n g.event = function (i, v, s) {\n g(\"event\", { n: i, p: v }, s);\n };\n g.shutdown = function () {\n g(\"rec\", !1);\n };\n g.restart = function () {\n g(\"rec\", !0);\n };\n g.log = function (a, b) {\n g(\"log\", [a, b]);\n };\n g.consent = function (a) {\n g(\"consent\", !arguments.length || a);\n };\n g.identifyAccount = function (i, v) {\n o = \"account\";\n v = v || {};\n v.acctId = i;\n g(o, v);\n };\n g.clearUserCookie = function () {};\n g._w = {};\n y = \"XMLHttpRequest\";\n g._w[y] = m[y];\n y = \"fetch\";\n g._w[y] = m[y];\n if (m[y])\n m[y] = function () {\n return g._w[y].apply(this, arguments);\n };\n })(window, document, window._fs_namespace, \"script\", \"user\");\n }\n\n page(rudderElement) {\n logger.debug(\"in FULLSORY page\");\n const rudderMessage = rudderElement.message;\n const pageName = rudderMessage.name;\n const props = {\n name: pageName,\n ...rudderMessage.properties,\n };\n\n window.FS.event(\"Viewed a Page\", Fullstory.getFSProperties(props));\n }\n\n identify(rudderElement) {\n logger.debug(\"in FULLSORY identify\");\n let { userId } = rudderElement.message;\n const { traits } = rudderElement.message.context;\n if (!userId) userId = rudderElement.message.anonymousId;\n\n if (Object.keys(traits).length === 0 && traits.constructor === Object)\n window.FS.identify(userId);\n else window.FS.identify(userId, Fullstory.getFSProperties(traits));\n }\n\n track(rudderElement) {\n logger.debug(\"in FULLSTORY track\");\n window.FS.event(\n rudderElement.message.event,\n Fullstory.getFSProperties(rudderElement.message.properties)\n );\n }\n\n isLoaded() {\n logger.debug(\"in FULLSTORY isLoaded\");\n return !!window.FS;\n }\n}\n\nexport { Fullstory };\n","/* eslint-disable camelcase */\n/* eslint-disable no-underscore-dangle */\nimport ScriptLoader from \"../ScriptLoader\";\nimport logger from \"../../utils/logUtil\";\n\nclass TVSquared {\n constructor(config) {\n this.brandId = config.brandId;\n this.clientId = config.clientId;\n this.eventWhiteList = config.eventWhiteList || [];\n this.customMetrics = config.customMetrics || [];\n this.name = \"TVSquared\";\n }\n\n init() {\n logger.debug(\"===in init TVSquared===\");\n window._tvq = window._tvq || [];\n let url = document.location.protocol === \"https:\" ? \"https://\" : \"http://\";\n url += `collector-${this.clientId}.tvsquared.com/`;\n window._tvq.push([\"setSiteId\", this.brandId]);\n window._tvq.push([\"setTrackerUrl\", `${url}tv2track.php`]);\n ScriptLoader(\"TVSquared-integration\", `${url}tv2track.js`);\n }\n\n isLoaded = () => {\n logger.debug(\"in TVSqaured isLoaded\");\n return !!(window._tvq && window._tvq.push !== Array.prototype.push);\n };\n\n isReady = () => {\n logger.debug(\"in TVSqaured isReady\");\n return !!(window._tvq && window._tvq.push !== Array.prototype.push);\n };\n\n page = () => {\n window._tvq.push([\"trackPageView\"]);\n };\n\n track(rudderElement) {\n const { event, userId, anonymousId } = rudderElement.message;\n const {\n revenue,\n productType,\n category,\n order_id,\n promotion_id,\n } = rudderElement.message.properties;\n let i;\n let j;\n let whitelist = this.eventWhiteList.slice();\n whitelist = whitelist.filter((wl) => {\n return wl.event !== \"\";\n });\n for (i = 0; i < whitelist.length; i += 1) {\n if (event.toUpperCase() === whitelist[i].event.toUpperCase()) {\n break;\n }\n if (i === whitelist.length - 1) {\n return;\n }\n }\n\n const session = { user: userId || anonymousId || \"\" };\n const action = {\n rev: revenue ? this.formatRevenue(revenue) : \"\",\n prod: category || productType || \"\",\n id: order_id || \"\",\n promo: promotion_id || \"\",\n };\n let customMetrics = this.customMetrics.slice();\n customMetrics = customMetrics.filter((cm) => {\n return cm.propertyName !== \"\";\n });\n if (customMetrics.length) {\n for (j = 0; j < customMetrics.length; j += 1) {\n const key = customMetrics[j].propertyName;\n const value = rudderElement.message.properties[key];\n if (value) {\n action[key] = value;\n }\n }\n }\n window._tvq.push([\n function () {\n this.setCustomVariable(5, \"session\", JSON.stringify(session), \"visit\");\n },\n ]);\n if (event.toUpperCase() !== \"RESPONSE\") {\n window._tvq.push([\n function () {\n this.setCustomVariable(5, event, JSON.stringify(action), \"page\");\n },\n ]);\n window._tvq.push([\"trackPageView\"]);\n }\n };\n\n formatRevenue = (revenue) => {\n let rev = revenue;\n rev = parseFloat(rev.toString().replace(/^[^\\d.]*/, \"\"));\n return rev;\n };\n}\nexport default TVSquared;\n","const requiredEventParameters = {\n PromotionId: \"promotion_id\",\n PromotionName: \"promotion_name\",\n Search: \"search_term\",\n ProductId: \"item_id\",\n ProductName: \"item_name\",\n};\n\n// To Do : Future Scope :: We can remove this one and add everything in include list.\n// This will also simplify our existing code and complex logics related to that\nconst includeParams = {\n CartShare: {\n defaults: {\n content_type: \"Cart\",\n },\n mappings: {\n share_via: \"method\",\n cart_id: \"content_id\",\n },\n },\n ProductShare: {\n defaults: {\n content_type: \"Product\",\n },\n mappings: {\n share_via: \"method\",\n product_id: \"content_id\",\n },\n },\n Search: {\n mappings: {\n query: \"search_term\",\n },\n },\n Promotion: {\n mappings: {\n position: \"location_id\",\n },\n },\n};\n\nconst eventParametersConfigArray = {\n ListId: { src: \"list_id\", dest: \"item_list_id\", inItems: true },\n Category: { src: \"category\", dest: \"item_list_name\", inItems: true },\n Price: { src: \"price\", dest: \"value\" },\n Currency: { src: \"currency\", dest: \"currency\", inItems: true },\n Coupon: { src: \"coupon\", dest: \"coupon\", inItems: true },\n Affiliation: { src: \"affiliation\", dest: \"affiliation\", inItems: true },\n Shipping: { src: \"shipping\", dest: \"shipping\" },\n Tax: { src: \"tax\", dest: \"tax\" },\n Total: { src: \"total\", dest: \"value\" },\n CheckoutId: { src: \"checkout_id\", dest: \"transaction_id\" },\n ShippingMethod: { src: \"shipping_method\", dest: \"shipping_tier\" },\n PaymentMethod: { src: \"payment_method\", dest: \"payment_type\" },\n};\n\nconst itemParametersConfigArray = [\n { src: \"product_id\", dest: \"item_id\" },\n { src: \"order_id\", dest: \"item_id\" },\n { src: \"name\", dest: \"item_name\" },\n { src: \"coupon\", dest: \"coupon\" },\n { src: \"category\", dest: \"item_category\" },\n { src: \"brand\", dest: \"item_brand\" },\n { src: \"variant\", dest: \"item_variant\" },\n { src: \"price\", dest: \"price\" },\n { src: \"quantity\", dest: \"quantity\" },\n { src: \"position\", dest: \"index\" },\n];\n\nconst eventNamesConfigArray = [\n // Browsing Section\n {\n src: [\"products searched\", \"product searched\"],\n dest: \"search\",\n requiredParams: requiredEventParameters.Search,\n onlyIncludeParams: includeParams.Search,\n },\n {\n src: [\"product list viewed\"],\n dest: \"view_item_list\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.ListId,\n eventParametersConfigArray.Category,\n ],\n },\n\n // Promotion Section\n {\n src: [\"promotion viewed\"],\n dest: \"view_promotion\",\n onlyIncludeParams: includeParams.Promotion,\n },\n {\n src: [\"promotion clicked\"],\n dest: \"select_promotion\",\n onlyIncludeParams: includeParams.Promotion,\n },\n\n // Ordering Section\n {\n src: [\"product clicked\", \"products clicked\"],\n dest: \"select_item\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.ListId,\n eventParametersConfigArray.Category,\n ],\n },\n {\n src: [\"product viewed\"],\n dest: \"view_item\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"product added\"],\n dest: \"add_to_cart\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"product removed\"],\n dest: \"remove_from_cart\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"cart viewed\"],\n dest: \"view_cart\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"checkout started\"],\n dest: \"begin_checkout\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Coupon,\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"payment info entered\"],\n dest: \"add_payment_info\",\n hasItem: false,\n includeList: [eventParametersConfigArray.PaymentMethod],\n },\n {\n src: [\"payment info entered\"],\n dest: \"add_shipping_info\",\n hasItem: false,\n includeList: [eventParametersConfigArray.ShippingMethod],\n },\n {\n src: [\"order completed\"],\n dest: \"purchase\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Affiliation,\n eventParametersConfigArray.Coupon,\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.CheckoutId,\n eventParametersConfigArray.Shipping,\n eventParametersConfigArray.Tax,\n eventParametersConfigArray.Total,\n ],\n },\n {\n src: [\"order refunded\"],\n dest: \"refund\",\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Affiliation,\n eventParametersConfigArray.Coupon,\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.CheckoutId,\n eventParametersConfigArray.Shipping,\n eventParametersConfigArray.Tax,\n eventParametersConfigArray.Total,\n ],\n },\n\n /* Coupon Section\n No Coupon Events present in GA4\n /---------- */\n\n // Wishlist Section\n {\n src: [\"product added to wishlist\"],\n dest: \"add_to_wishlist\",\n requiredParams: [\n requiredEventParameters.ProductId,\n requiredEventParameters.ProductName,\n ],\n hasItem: true,\n includeList: [\n eventParametersConfigArray.Currency,\n eventParametersConfigArray.Total,\n ],\n },\n //-------\n\n // Sharing Section\n {\n src: [\"product shared\"],\n dest: \"share\",\n hasItem: false,\n onlyIncludeParams: includeParams.ProductShare,\n },\n\n {\n src: [\"cart shared\"],\n dest: \"share\",\n hasItem: false,\n onlyIncludeParams: includeParams.CartShare,\n },\n //---------\n];\n\nexport {\n eventNamesConfigArray,\n eventParametersConfigArray,\n itemParametersConfigArray,\n};\n","const pageEventParametersConfigArray = [\n { src: \"path\", dest: \"page_location\" },\n { src: \"referrer\", dest: \"page_referrer\" },\n { src: \"title\", dest: \"page_title\" },\n];\n\nexport { pageEventParametersConfigArray };\n","import {\n eventNamesConfigArray,\n itemParametersConfigArray,\n} from \"./ECommerceEventConfig\";\n\nimport { pageEventParametersConfigArray } from \"./PageEventConfig\";\nimport { type } from \"../../utils/utils\";\nimport logger from \"../../utils/logUtil\";\n\n/**\n * Check if event name is not one of the following reserved names\n * @param {*} name\n */\nfunction isReservedName(name) {\n const reservedEventNames = [\n \"ad_activeview\",\n \"ad_click\",\n \"ad_exposure\",\n \"ad_impression\",\n \"ad_query\",\n \"adunit_exposure\",\n \"app_clear_data\",\n \"app_install\",\n \"app_update\",\n \"app_remove\",\n \"error\",\n \"first_open\",\n \"first_visit\",\n \"in_app_purchase\",\n \"notification_dismiss\",\n \"notification_foreground\",\n \"notification_open\",\n \"notification_receive\",\n \"os_update\",\n \"screen_view\",\n \"session_start\",\n \"user_engagement\",\n ];\n\n return reservedEventNames.includes(name);\n}\n\n/**\n * map rudder event name to ga4 ecomm event name and return array\n * @param {*} event\n */\nfunction getDestinationEventName(event) {\n return eventNamesConfigArray.filter((p) =>\n p.src.includes(event.toLowerCase())\n );\n}\n\n/**\n * Create item array and add into destination parameters\n * If 'items' prop is present push new key value into it else create a new and push data\n * 'items' -> name of GA4 Ecommerce property name.\n * For now its hard coded, we can think of some better soln. later.\n * @param {*} dest\n * @param {*} key\n * @param {*} value\n */\nfunction createItemProperty(dest, key, value) {\n const destinationProperties = dest;\n if (!destinationProperties.items) {\n destinationProperties.items = [];\n destinationProperties.items.push({ [key]: value });\n } else {\n destinationProperties.items[0][key] = value;\n }\n return destinationProperties;\n}\n\n/**\n * Check if your payload contains required parameters to map to ga4 ecomm\n * @param {*} includeRequiredParams this can be boolean or an array or required object\n * @param {*} key\n * @param {*} src\n */\nfunction hasRequiredParameters(props, eventMappingObj) {\n const requiredParams = eventMappingObj.requiredParams || false;\n if (!requiredParams) return true;\n if (!Array.isArray(requiredParams)) {\n if (props[requiredParams]) {\n return true;\n }\n return false;\n }\n for (const i in props.items) {\n for (const p in requiredParams) {\n if (!props.items[i][requiredParams[p]]) {\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * TO DO Future Improvement ::::\n * Here we only support mapping single level object mapping.\n * Implement using recursion to handle multi level prop mapping.\n * @param {*} props { product_id: 123456_abcdef, name: \"chess-board\", list_id: \"ls_abcdef\", category: games }\n * @param {*} destParameterConfig\n * Defined Parameter present GA4/utils.js ex: [{ src: \"category\", dest: \"item_list_name\", inItems: true }]\n * @param {*} includeRequiredParams contains object of required parameter to be mapped from source payload\n * output: {\n \"item_list_id\": \"ls_abcdef\",\n \"items\": [\n {\n \"item_id\": \"123456_abcdef\",\n \"item_name\": \"chess-board\",\n \"item_list_id\": \"ls_abc\",\n \"item_list_name\": \"games\"\n }\n ],\n \"item_list_name\": \"games\"\n}\n*/\nfunction getDestinationEventProperties(\n props,\n destParameterConfig,\n hasItem = true\n) {\n let destinationProperties = {};\n Object.keys(props).forEach((key) => {\n destParameterConfig.forEach((param) => {\n if (key === param.src) {\n // handle case where the key needs to go inside items as well as top level params in GA4\n if (param.inItems && hasItem) {\n destinationProperties = createItemProperty(\n destinationProperties,\n param.dest,\n props[key]\n );\n }\n destinationProperties[param.dest] = props[key];\n // eslint-disable-next-line no-param-reassign\n delete props[key];\n }\n });\n });\n return destinationProperties;\n}\n\n/**\n * Map rudder products arrays payload to ga4 ecomm items array\n * @param {*} products\n * @param {*} item\n */\nfunction getDestinationItemProperties(products, item) {\n const items = [];\n let obj = {};\n if (type(products) !== \"array\") {\n logger.debug(\"Event payload doesn't have products array\");\n } else {\n // get the dest keys from itemParameters config\n // append the already created item object keys (this is done to get the keys that are actually top level props in Rudder payload but GA expects them under items too)\n products.forEach((p) => {\n obj = {\n ...getDestinationEventProperties(p, itemParametersConfigArray),\n ...((item && type(item) === \"array\" && item[0]) || {}),\n };\n items.push(obj);\n });\n }\n return items;\n}\n\n/**\n * Generate ga4 page_view events payload\n * @param {*} props\n */\nfunction getPageViewProperty(props) {\n return getDestinationEventProperties(props, pageEventParametersConfigArray);\n}\n\nexport {\n isReservedName,\n getDestinationEventName,\n getDestinationEventProperties,\n getDestinationItemProperties,\n getPageViewProperty,\n hasRequiredParameters,\n};\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([bth[buf[i++]], bth[buf[i++]], \n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]], '-',\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]],\n\tbth[buf[i++]], bth[buf[i++]]]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","/* eslint-disable class-methods-use-this */\nimport logger from \"../../utils/logUtil\";\nimport ScriptLoader from \"../ScriptLoader\";\n\nimport {\n isReservedName,\n getDestinationEventName,\n getDestinationEventProperties,\n getDestinationItemProperties,\n getPageViewProperty,\n hasRequiredParameters,\n} from \"./utils\";\nimport { type, flattenJsonPayload } from \"../../utils/utils\";\n\nexport default class GA4 {\n constructor(config, analytics) {\n this.measurementId = config.measurementId;\n this.analytics = analytics;\n this.sendUserId = config.sendUserId || false;\n this.blockPageView = config.blockPageViewEvent || false;\n this.extendPageViewParams = config.extendPageViewParams || false;\n this.name = \"GA4\";\n }\n\n loadScript(measurementId, userId) {\n window.dataLayer = window.dataLayer || [];\n window.gtag =\n window.gtag ||\n function gt() {\n // eslint-disable-next-line prefer-rest-params\n window.dataLayer.push(arguments);\n };\n window.gtag(\"js\", new Date());\n\n // This condition is not working, even after disabling page view\n // page_view is even getting called on page load\n if (this.blockPageView) {\n if (this.sendUserId) {\n window.gtag(\"config\", measurementId, {\n user_id: userId,\n send_page_view: false,\n });\n } else {\n window.gtag(\"config\", measurementId, {\n send_page_view: false,\n });\n }\n } else if (this.sendUserId) {\n window.gtag(\"config\", measurementId, {\n user_id: userId,\n });\n } else {\n window.gtag(\"config\", measurementId);\n }\n\n ScriptLoader(\n \"google-analytics 4\",\n `https://www.googletagmanager.com/gtag/js?id=${measurementId}`\n );\n }\n\n init() {\n // To do :: check how custom dimension and metrics is used\n const userId = this.analytics.userId || this.analytics.anonymousId;\n this.loadScript(this.measurementId, userId);\n }\n\n /* utility functions ---Start here --- */\n isLoaded() {\n return !!(window.gtag && window.gtag.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window.gtag && window.gtag.push !== Array.prototype.push);\n }\n /* utility functions --- Ends here --- */\n\n /**\n * Function to get destination properties for both event parameters and items array if present\n * For top level properties, include only those properties that are in the includeList\n * @param {*} properties\n * @param {*} hasItem\n * @param {*} products\n * @param {*} includeList\n */\n getdestinationProperties(properties, hasItem, products, includeList) {\n let destinationProperties = {};\n destinationProperties = getDestinationEventProperties(\n properties,\n includeList,\n hasItem\n );\n\n if (hasItem) {\n // only for events where GA requires an items array to be sent\n // get the product related destination keys || if products is not present use the rudder message properties to get the product related destination keys\n destinationProperties.items = getDestinationItemProperties(\n products || [properties],\n destinationProperties.items\n );\n }\n\n return destinationProperties;\n }\n\n /**\n * Only include params that are present in given mapping config for things like Cart/Product shared, Product/Products shared\n * @param {*} params\n * @param {*} properties\n */\n getIncludedParameters(params, properties) {\n const destinationProperties = {};\n if (type(params) === \"object\") {\n const { defaults, mappings } = params;\n if (type(defaults) === \"object\") {\n Object.keys(defaults).forEach((key) => {\n destinationProperties[key] = defaults[key];\n });\n }\n if (type(mappings) === \"object\") {\n Object.keys(mappings).forEach((key) => {\n destinationProperties[mappings[key]] = properties[key];\n });\n }\n }\n return destinationProperties;\n }\n\n sendGAEvent(event, parameters, checkRequiredParameters, eventMappingObj) {\n if (checkRequiredParameters) {\n if (!hasRequiredParameters(parameters, eventMappingObj)) {\n throw Error(\"Payload must have required parameters..\");\n }\n }\n window.gtag(\"event\", event, parameters);\n }\n\n handleEventMapper(eventMappingObj, properties, products) {\n let destinationProperties = {};\n const event = eventMappingObj.dest;\n if (eventMappingObj.onlyIncludeParams) {\n /* Only include params that are present in given mapping config for things like Cart/Product shared, Product/Products shared\n */\n const includeParams = eventMappingObj.onlyIncludeParams;\n destinationProperties = this.getIncludedParameters(\n includeParams,\n properties\n );\n } else {\n destinationProperties = this.getdestinationProperties(\n properties,\n eventMappingObj.hasItem,\n products,\n eventMappingObj.includeList\n );\n }\n this.sendGAEvent(event, destinationProperties, true, eventMappingObj);\n }\n\n /**\n *\n * @param {*} rudderElement\n */\n track(rudderElement) {\n const { event } = rudderElement.message;\n const { properties } = rudderElement.message;\n const { products } = properties;\n if (!event || isReservedName(event)) {\n throw Error(\"Cannot call un-named/reserved named track event\");\n }\n // get GA4 event name and corresponding configs defined to add properties to that event\n const eventMappingArray = getDestinationEventName(event);\n if (eventMappingArray && eventMappingArray.length) {\n eventMappingArray.forEach((events) => {\n this.handleEventMapper(events, properties, products);\n });\n } else {\n this.sendGAEvent(event, flattenJsonPayload(properties), false);\n }\n }\n\n identify(rudderElement) {\n window.gtag(\n \"set\",\n \"user_properties\",\n flattenJsonPayload(this.analytics.userTraits)\n );\n if (this.sendUserId && rudderElement.message.userId) {\n const userId = this.analytics.userId || this.analytics.anonymousId;\n if (this.blockPageView) {\n window.gtag(\"config\", this.measurementId, {\n user_id: userId,\n send_page_view: false,\n });\n } else {\n window.gtag(\"config\", this.measurementId, {\n user_id: userId,\n });\n }\n }\n\n logger.debug(\"in GoogleAnalyticsManager identify\");\n }\n\n page(rudderElement) {\n let pageProps = rudderElement.message.properties;\n if (!pageProps) return;\n pageProps = flattenJsonPayload(pageProps);\n if (this.extendPageViewParams) {\n window.gtag(\"event\", \"page_view\", {\n ...pageProps,\n ...getPageViewProperty(pageProps),\n });\n } else {\n window.gtag(\"event\", \"page_view\", getPageViewProperty(pageProps));\n }\n }\n}\n","import each from \"@ndhoule/each\";\nimport logger from \"../../utils/logUtil\";\n\n// custom traits mapping context.traits --> moengage properties\nconst traitsMap = {\n firstName: \"first_name\",\n lastName: \"last_name\",\n firstname: \"first_name\",\n lastname: \"last_name\",\n email: \"email\",\n phone: \"mobile\",\n name: \"user_name\",\n username: \"user_name\",\n userName: \"user_name\",\n gender: \"gender\",\n birthday: \"birthday\",\n id: null,\n};\nclass MoEngage {\n constructor(config, analyticsinstance) {\n this.apiId = config.apiId;\n this.debug = config.debug;\n this.region = config.region;\n this.name = \"MoEngage\";\n this.analyticsinstance = analyticsinstance;\n }\n\n init() {\n const self = this;\n logger.debug(\"===in init MoEnagage===\");\n // loading the script for moengage web sdk\n /* eslint-disable */\n (function (i, s, o, g, r, a, m, n) {\n i.moengage_object = r;\n var t = {};\n var q = function (f) {\n return function () {\n (i.moengage_q = i.moengage_q || []).push({ f, a: arguments });\n };\n };\n var f = [\n \"track_event\",\n \"add_user_attribute\",\n \"add_first_name\",\n \"add_last_name\",\n \"add_email\",\n \"add_mobile\",\n \"add_user_name\",\n \"add_gender\",\n \"add_birthday\",\n \"destroy_session\",\n \"add_unique_user_id\",\n \"moe_events\",\n \"call_web_push\",\n \"track\",\n \"location_type_attribute\",\n ];\n var h = { onsite: [\"getData\", \"registerCallback\"] };\n for (var k in f) {\n t[f[k]] = q(f[k]);\n }\n for (var k in h)\n for (var l in h[k]) {\n null == t[k] && (t[k] = {}), (t[k][h[k][l]] = q(k + \".\" + h[k][l]));\n }\n a = s.createElement(o);\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n i.moe =\n i.moe ||\n function () {\n n = arguments[0];\n return t;\n };\n a.onload = function () {\n if (n) {\n i[r] = moe(n);\n }\n };\n })(\n window,\n document,\n \"script\",\n document.location.protocol === \"https:\"\n ? \"https://cdn.moengage.com/webpush/moe_webSdk.min.latest.js\"\n : \"http://cdn.moengage.com/webpush/moe_webSdk.min.latest.js\",\n \"Moengage\"\n );\n /* eslint-enable */\n\n // setting the region if us then not needed.\n if (this.region !== \"US\") {\n self.moeClient = window.moe({\n app_id: this.apiId,\n debug_logs: this.debug ? 1 : 0,\n cluster: this.region === \"EU\" ? \"eu\" : \"in\",\n });\n } else {\n self.moeClient = window.moe({\n app_id: this.apiId,\n debug_logs: this.debug ? 1 : 0,\n });\n }\n this.initialUserId = this.analyticsinstance.userId;\n }\n\n isLoaded = () => {\n logger.debug(\"in MoEngage isLoaded\");\n return !!window.moeBannerText;\n };\n\n isReady = () => {\n logger.debug(\"in MoEngage isReady\");\n return !!window.moeBannerText;\n };\n\n track(rudderElement) {\n logger.debug(\"inside track\");\n // Check if the user id is same as previous session if not a new session will start\n if (!rudderElement.message) {\n logger.error(\"Payload not correct\");\n return;\n }\n const { event, properties, userId } = rudderElement.message;\n if (userId) {\n if (this.initialUserId !== userId) {\n this.reset();\n }\n }\n // track event : https://docs.moengage.com/docs/tracking-events\n if (!event) {\n logger.error(\"Event name not present\");\n return;\n }\n if (properties) {\n this.moeClient.track_event(event, properties);\n } else {\n this.moeClient.track_event(event);\n }\n }\n\n reset() {\n logger.debug(\"inside reset\");\n // reset the user id\n this.initialUserId = this.analyticsinstance.userId;\n this.moeClient.destroy_session();\n }\n\n identify(rudderElement) {\n const self = this;\n const { userId } = rudderElement.message;\n let traits = null;\n if (rudderElement.message.context) {\n traits = rudderElement.message.context.traits;\n }\n // check if user id is same or not\n if (this.initialUserId !== userId) {\n this.reset();\n }\n // if user is present map\n if (userId) {\n this.moeClient.add_unique_user_id(userId);\n }\n\n // track user attributes : https://docs.moengage.com/docs/tracking-web-user-attributes\n if (traits) {\n each(function add(value, key) {\n // check if name is present\n if (key === \"name\") {\n self.moeClient.add_user_name(value);\n }\n if (Object.prototype.hasOwnProperty.call(traitsMap, key)) {\n const method = `add_${traitsMap[key]}`;\n self.moeClient[method](value);\n } else {\n self.moeClient.add_user_attribute(key, value);\n }\n }, traits);\n }\n }\n}\n\nexport default MoEngage;\n","/* eslint-disable class-methods-use-this */\nimport logger from \"../../utils/logUtil\";\nimport { type } from \"../../utils/utils\";\n\nclass Amplitude {\n constructor(config, analytics) {\n this.name = \"AM\";\n this.analytics = analytics;\n this.apiKey = config.apiKey;\n this.trackAllPages = config.trackAllPages || false;\n this.trackNamedPages = config.trackNamedPages || false;\n this.trackCategorizedPages = config.trackCategorizedPages || false;\n this.trackUtmProperties = config.trackUtmProperties || false;\n this.trackReferrer = config.trackReferrer || false;\n this.batchEvents = config.batchEvents || false;\n this.eventUploadThreshold = +config.eventUploadThreshold || 30;\n this.eventUploadPeriodMillis = +config.eventUploadPeriodMillis || 30000;\n this.forceHttps = config.forceHttps || false;\n this.trackGclid = config.trackGclid || false;\n this.saveParamsReferrerOncePerSession =\n config.saveParamsReferrerOncePerSession || false;\n this.deviceIdFromUrlParam = config.deviceIdFromUrlParam || false;\n // this.mapQueryParams = config.mapQueryParams;\n this.trackRevenuePerProduct = config.trackRevenuePerProduct || false;\n this.preferAnonymousIdForDeviceId =\n config.preferAnonymousIdForDeviceId || false;\n this.traitsToSetOnce = [];\n this.traitsToIncrement = [];\n this.appendFieldsToEventProps = config.appendFieldsToEventProps || false;\n this.unsetParamsReferrerOnNewSession =\n config.unsetParamsReferrerOnNewSession || false;\n this.trackProductsOnce = config.trackProductsOnce || false;\n this.versionName = config.versionName;\n\n if (config.traitsToSetOnce && config.traitsToSetOnce.length > 0) {\n config.traitsToSetOnce.forEach((element) => {\n if (element && element.traits && element.traits !== \"\") {\n this.traitsToSetOnce.push(element.traits);\n }\n });\n }\n if (config.traitsToIncrement && config.traitsToIncrement.length > 0) {\n config.traitsToIncrement.forEach((element) => {\n if (element && element.traits && element.traits !== \"\") {\n this.traitsToIncrement.push(element.traits);\n }\n });\n }\n }\n\n init() {\n (function (e, t) {\n const n = e.amplitude || {\n _q: [],\n _iq: {},\n };\n const r = t.createElement(\"script\");\n r.type = \"text/javascript\";\n r.integrity =\n \"sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M\";\n r.crossOrigin = \"anonymous\";\n r.async = true;\n r.src = \"https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js\";\n r.onload = function () {\n if (!e.amplitude.runQueuedFunctions) {\n console.log(\"[Amplitude] Error: could not load SDK\");\n }\n };\n const i = t.getElementsByTagName(\"script\")[0];\n i.parentNode.insertBefore(r, i);\n\n function s(e, t) {\n e.prototype[t] = function () {\n this._q.push([t].concat(Array.prototype.slice.call(arguments, 0)));\n return this;\n };\n }\n const o = function () {\n this._q = [];\n return this;\n };\n const a = [\n \"add\",\n \"append\",\n \"clearAll\",\n \"prepend\",\n \"set\",\n \"setOnce\",\n \"unset\",\n ];\n for (let c = 0; c < a.length; c++) {\n s(o, a[c]);\n }\n n.Identify = o;\n const u = function () {\n this._q = [];\n return this;\n };\n const l = [\n \"setProductId\",\n \"setQuantity\",\n \"setPrice\",\n \"setRevenueType\",\n \"setEventProperties\",\n ];\n for (let p = 0; p < l.length; p++) {\n s(u, l[p]);\n }\n n.Revenue = u;\n const d = [\n \"init\",\n \"logEvent\",\n \"logRevenue\",\n \"setUserId\",\n \"setUserProperties\",\n \"setOptOut\",\n \"setVersionName\",\n \"setDomain\",\n \"setDeviceId\",\n \"enableTracking\",\n \"setGlobalUserProperties\",\n \"identify\",\n \"clearUserProperties\",\n \"setGroup\",\n \"logRevenueV2\",\n \"regenerateDeviceId\",\n \"groupIdentify\",\n \"onInit\",\n \"logEventWithTimestamp\",\n \"logEventWithGroups\",\n \"setSessionId\",\n \"resetSessionId\",\n ];\n\n function v(e) {\n function t(t) {\n e[t] = function () {\n e._q.push([t].concat(Array.prototype.slice.call(arguments, 0)));\n };\n }\n for (let n = 0; n < d.length; n++) {\n t(d[n]);\n }\n }\n v(n);\n n.getInstance = function (e) {\n e = (!e || e.length === 0 ? \"$default_instance\" : e).toLowerCase();\n if (!n._iq.hasOwnProperty(e)) {\n n._iq[e] = {\n _q: [],\n };\n v(n._iq[e]);\n }\n return n._iq[e];\n };\n e.amplitude = n;\n })(window, document);\n\n const initOptions = {\n includeUtm: this.trackUtmProperties,\n batchEvents: this.batchEvents,\n eventUploadThreshold: this.eventUploadThreshold,\n eventUploadPeriodMillis: this.eventUploadPeriodMillis,\n forceHttps: this.forceHttps,\n includeGclid: this.trackGclid,\n includeReferrer: this.trackReferrer,\n saveParamsReferrerOncePerSession: this.saveParamsReferrerOncePerSession,\n deviceIdFromUrlParam: this.deviceIdFromUrlParam,\n unsetParamsReferrerOnNewSession: this.unsetParamsReferrerOnNewSession,\n deviceId:\n this.preferAnonymousIdForDeviceId &&\n this.analytics &&\n this.analytics.getAnonymousId(),\n };\n window.amplitude.getInstance().init(this.apiKey, null, initOptions);\n if (this.versionName) {\n window.amplitude.getInstance().setVersionName(this.versionName);\n }\n }\n\n identify(rudderElement) {\n logger.debug(\"in Amplitude identify\");\n\n this.setDeviceId(rudderElement);\n\n // rudderElement.message.context will always be present as part of identify event payload.\n const { traits } = rudderElement.message.context;\n const { userId } = rudderElement.message;\n\n if (userId) {\n window.amplitude.getInstance().setUserId(userId);\n }\n\n if (traits) {\n const amplitudeIdentify = new window.amplitude.Identify();\n for (const trait in traits) {\n if (!traits.hasOwnProperty(trait)) {\n continue;\n }\n\n const shouldIncrement = this.traitsToIncrement.indexOf(trait) >= 0;\n const shouldSetOnce = this.traitsToSetOnce.indexOf(trait) >= 0;\n\n if (shouldIncrement) {\n amplitudeIdentify.add(trait, traits[trait]);\n }\n\n if (shouldSetOnce) {\n amplitudeIdentify.setOnce(trait, traits[trait]);\n }\n\n if (!shouldIncrement && !shouldSetOnce) {\n amplitudeIdentify.set(trait, traits[trait]);\n }\n }\n window.amplitude.identify(amplitudeIdentify);\n }\n }\n\n track(rudderElement) {\n logger.debug(\"in Amplitude track\");\n this.setDeviceId(rudderElement);\n\n const { properties } = rudderElement.message;\n\n // message.properties will always be present as part of track event.\n const { products } = properties;\n\n const clonedTrackEvent = {};\n Object.assign(clonedTrackEvent, rudderElement.message);\n\n // For track products once, we will send the products in a single call.\n if (this.trackProductsOnce) {\n if (products && type(products) == \"array\") {\n // track all the products in a single event.\n const allProducts = [];\n\n const productKeys = Object.keys(products);\n for (let index = 0; index < productKeys.length; index++) {\n let product = {};\n product = this.getProductAttributes(products[index]);\n allProducts.push(product);\n }\n\n clonedTrackEvent.properties.products = allProducts;\n\n this.logEventAndCorrespondingRevenue(\n clonedTrackEvent,\n this.trackRevenuePerProduct\n ); // we do not want to track revenue as a whole if trackRevenuePerProduct is enabled.\n\n // If trackRevenuePerProduct is enabled, track revenues per product.\n if (this.trackRevenuePerProduct) {\n const trackEventMessage = {};\n Object.assign(trackEventMessage, clonedTrackEvent);\n this.trackingEventAndRevenuePerProduct(\n trackEventMessage,\n products,\n false\n ); // also track revenue only and not event per product.\n }\n } else {\n // track event and revenue as a whole as products array is not available.\n this.logEventAndCorrespondingRevenue(clonedTrackEvent, false);\n }\n return;\n }\n\n if (products && type(products) == \"array\") {\n // track events iterating over product array individually.\n\n // Log the actuall event without products array. We will subsequently track each product with 'Product Purchased' event.\n delete clonedTrackEvent.properties.products;\n this.logEventAndCorrespondingRevenue(\n clonedTrackEvent,\n this.trackRevenuePerProduct\n );\n\n const trackEventMessage = {};\n Object.assign(trackEventMessage, clonedTrackEvent);\n\n // track products and revenue per product basis.\n this.trackingEventAndRevenuePerProduct(trackEventMessage, products, true); // track both event and revenue on per product basis.\n } else {\n // track event and revenue as a whole as no product array is present.\n this.logEventAndCorrespondingRevenue(clonedTrackEvent, false);\n }\n }\n\n trackingEventAndRevenuePerProduct(\n trackEventMessage,\n products,\n shouldTrackEventPerProduct\n ) {\n let { revenue, revenueType, revenue_type } = trackEventMessage.properties;\n revenueType = revenueType || revenue_type;\n for (let index = 0; index < products.length; index++) {\n const product = products[index];\n trackEventMessage.properties = product;\n trackEventMessage.event = \"Product Purchased\";\n if (this.trackRevenuePerProduct) {\n if (revenueType) {\n trackEventMessage.properties.revenueType = revenueType;\n }\n if (revenue) {\n trackEventMessage.properties.revenue = revenue;\n }\n this.trackRevenue(trackEventMessage);\n }\n if (shouldTrackEventPerProduct) {\n this.logEventAndCorrespondingRevenue(trackEventMessage, true);\n }\n }\n }\n\n // Always to be called for general and top level events (and not product level)\n // For these events we expect top level revenue property.\n logEventAndCorrespondingRevenue(rudderMessage, dontTrackRevenue) {\n const { properties, event } = rudderMessage;\n\n window.amplitude.getInstance().logEvent(event, properties);\n if (properties.revenue && !dontTrackRevenue) {\n this.trackRevenue(rudderMessage);\n }\n }\n\n /**\n * track page events base on destination settings. If more than one settings is enabled, multiple events may be logged for a single page event.\n * For example, if category of a page is present, and both trackAllPages and trackCategorizedPages are enabled, then 2 events will be tracked for\n * a single pageview - 'Loaded a page' and `Viewed page ${category}`.\n *\n * @memberof Amplitude\n */\n page(rudderElement) {\n logger.debug(\"in Amplitude page\");\n this.setDeviceId(rudderElement);\n\n const { properties, name, category } = rudderElement.message;\n\n // all pages\n if (this.trackAllPages) {\n const event = \"Loaded a page\";\n amplitude.getInstance().logEvent(event, properties);\n }\n\n // categorized pages\n if (category && this.trackCategorizedPages) {\n const event = `Viewed page ${category}`;\n amplitude.getInstance().logEvent(event, properties);\n }\n\n // named pages\n if (name && this.trackNamedPages) {\n const event = `Viewed page ${name}`;\n amplitude.getInstance().logEvent(event, properties);\n }\n }\n\n group(rudderElement) {\n logger.debug(\"in Amplitude group\");\n\n this.setDeviceId(rudderElement);\n\n const { groupId, traits } = rudderElement.message;\n\n const { groupTypeTrait } = this;\n const { groupValueTrait } = this;\n\n if (groupTypeTrait && groupValueTrait && traits) {\n var groupType = traits[groupTypeTrait];\n var groupValue = traits[groupValueTrait];\n }\n\n if (groupType && groupValue) {\n window.amplitude.getInstance().setGroup(groupTypeTrait, groupValueTrait);\n } else if (groupId) {\n // Similar as segment but not sure whether we need it as our cloud mode supports only the above if block\n window.amplitude.getInstance().setGroup(\"[Rudderstack] Group\", groupId);\n }\n\n // https://developers.amplitude.com/docs/setting-user-properties#setting-group-properties\n // no other api for setting group properties for javascript\n }\n\n setDeviceId(rudderElement) {\n const { anonymousId } = rudderElement.message;\n if (this.preferAnonymousIdForDeviceId && anonymousId) {\n window.amplitude.getInstance().setDeviceId(anonymousId);\n }\n }\n\n /**\n * Tracks revenue with logRevenueV2() api based on revenue/price present in event payload. If neither of revenue/price present, it returns.\n * The event payload may contain ruddermessage of an original track event payload (from trackEvent method) or it is derived from a product\n * array (from trackingRevenuePerProduct) in an e-comm event.\n *\n * @param {*} rudderMessage\n * @returns\n * @memberof Amplitude\n */\n trackRevenue(rudderMessage) {\n const mapRevenueType = {\n \"order completed\": \"Purchase\",\n \"completed order\": \"Purchase\",\n \"product purchased\": \"Purchase\",\n };\n\n const { properties, event } = rudderMessage;\n let { price, productId, quantity, revenue, product_id } = properties;\n const revenueType =\n properties.revenueType ||\n properties.revenue_type ||\n mapRevenueType[event.toLowerCase()];\n\n productId = productId || product_id;\n\n // If neither revenue nor price is present, then return\n // else send price and quantity from properties to amplitude\n // If price not present set price as revenue's value and force quantity to be 1.\n // Ultimately set quantity to 1 if not already present from above logic.\n if (!revenue && !price) {\n console.debug(\"revenue or price is not present.\");\n return;\n }\n\n if (!price) {\n price = revenue;\n quantity = 1;\n }\n if (!quantity) {\n quantity = 1;\n }\n const amplitudeRevenue = new window.amplitude.Revenue()\n .setPrice(price)\n .setQuantity(quantity)\n .setEventProperties(properties);\n if (revenueType) {\n amplitudeRevenue.setRevenueType(revenueType);\n }\n\n if (productId) {\n amplitudeRevenue.setProductId(productId);\n }\n window.amplitude.getInstance().logRevenueV2(amplitudeRevenue);\n }\n\n getProductAttributes(product) {\n return {\n productId: product.productId || product.product_id,\n sku: product.sku,\n name: product.name,\n price: product.price,\n quantity: product.quantity,\n category: product.category,\n };\n }\n\n isLoaded() {\n logger.debug(\"in Amplitude isLoaded\");\n return !!(window.amplitude && window.amplitude.getInstance().options);\n }\n\n isReady() {\n return !!(window.amplitude && window.amplitude.getInstance().options);\n }\n}\n\nexport default Amplitude;\n","import * as HubSpot from \"./HubSpot\";\nimport * as GA from \"./GA\";\nimport * as Hotjar from \"./Hotjar\";\nimport * as GoogleAds from \"./GoogleAds\";\nimport * as VWO from \"./VWO\";\nimport * as GoogleTagManager from \"./GoogleTagManager\";\nimport * as Braze from \"./Braze\";\nimport * as INTERCOM from \"./INTERCOM\";\nimport * as Keen from \"./Keen\";\nimport * as Kissmetrics from \"./Kissmetrics\";\nimport * as CustomerIO from \"./CustomerIO\";\nimport * as Chartbeat from \"./Chartbeat\";\nimport * as Comscore from \"./Comscore\";\nimport * as FBPixel from \"./FacebookPixel\";\nimport * as Lotame from \"./Lotame\";\nimport * as Optimizely from \"./Optimizely\";\nimport * as Bugsnag from \"./Bugsnag\";\nimport * as Fullstory from \"./Fullstory\";\nimport * as TVSquared from \"./TVSquared\";\nimport * as GA4 from \"./GA4\";\nimport * as MoEngage from \"./MoEngage\";\nimport * as Amplitude from \"./Amplitude\";\nimport * as Pendo from \"./Pendo\";\nimport * as Lytics from \"./Lytics\";\nimport * as Appcues from \"./Appcues\";\n\n// the key names should match the destination.name value to keep partity everywhere\n// (config-plan name, native destination.name , exported integration name(this one below))\n\nconst integrations = {\n HS: HubSpot.default,\n GA: GA.default,\n HOTJAR: Hotjar.default,\n GOOGLEADS: GoogleAds.default,\n VWO: VWO.default,\n GTM: GoogleTagManager.default,\n BRAZE: Braze.default,\n INTERCOM: INTERCOM.default,\n KEEN: Keen.default,\n KISSMETRICS: Kissmetrics.default,\n CUSTOMERIO: CustomerIO.default,\n CHARTBEAT: Chartbeat.default,\n COMSCORE: Comscore.default,\n FACEBOOK_PIXEL: FBPixel.default,\n LOTAME: Lotame.default,\n OPTIMIZELY: Optimizely.default,\n BUGSNAG: Bugsnag.default,\n FULLSTORY: Fullstory.default,\n TVSQUARED: TVSquared.default,\n GA4: GA4.default,\n MOENGAGE: MoEngage.default,\n AM: Amplitude.default,\n PENDO: Pendo.default,\n LYTICS: Lytics.default,\n APPCUES: Appcues.default,\n};\n\nexport { integrations };\n","/* eslint-disable class-methods-use-this */\n/* eslint-disable lines-between-class-members */\nimport logger from \"../../utils/logUtil\";\n\nclass Pendo {\n constructor(config, analytics) {\n this.analytics = analytics;\n this.apiKey = !config.apiKey ? \"\" : config.apiKey;\n this.name = \"PENDO\";\n logger.debug(\"Config \", config);\n }\n\n init() {\n (function (apiKey) {\n (function (p, e, n, d, o) {\n var v, w, x, y, z;\n o = p[d] = p[d] || {};\n o._q = [];\n v = [\"initialize\", \"identify\", \"updateOptions\", \"pageLoad\", \"track\"];\n for (w = 0, x = v.length; w < x; ++w)\n (function (m) {\n o[m] =\n o[m] ||\n function () {\n o._q[m === v[0] ? \"unshift\" : \"push\"](\n [m].concat([].slice.call(arguments, 0))\n );\n };\n })(v[w]);\n y = e.createElement(n);\n y.async = !0;\n y.src = `https://cdn.pendo.io/agent/static/${apiKey}/pendo.js`;\n z = e.getElementsByTagName(n)[0];\n z.parentNode.insertBefore(y, z);\n })(window, document, \"script\", \"pendo\");\n })(this.apiKey);\n this.initializeMe();\n logger.debug(\"===in init Pendo===\");\n }\n\n initializeMe() {\n const userId =\n this.analytics.userId ||\n this.constructPendoAnonymousId(this.analytics.anonymousId);\n\n const accountObj = {\n id: this.analytics.groupId,\n ...this.analytics.groupTraits,\n };\n const visitorObj = { id: userId, ...this.analytics.userTraits };\n\n window.pendo.initialize({ account: accountObj, visitor: visitorObj });\n }\n\n /* utility functions ---Start here --- */\n isLoaded() {\n return !!(window.pendo && window.pendo.push !== Array.prototype.push);\n }\n\n isReady() {\n return !!(window.pendo && window.pendo.push !== Array.prototype.push);\n }\n\n constructPendoAnonymousId(id) {\n return `_PENDO_T_${id}`;\n }\n /* utility functions --- Ends here --- */\n\n /*\n * PENDO MAPPED FUNCTIONS :: identify, track, group\n */\n\n /* Pendo's identify call works intelligently, once u have identified a visitor/user,\n *or associated a visitor to a group/account then Pendo save this data in local storage and\n *any further upcoming calls are done taking user info from local.\n * To track user perndo maps user to Visitor in Pendo.\n */\n identify(rudderElement) {\n let visitorObj = {};\n let accountObj = {};\n const { groupId } = this.analytics;\n const id =\n this.analytics.userId ||\n this.constructPendoAnonymousId(this.analytics.anonymousId);\n visitorObj = {\n id,\n ...this.analytics.userTraits,\n };\n\n if (groupId) {\n accountObj = { id: groupId, ...this.analytics.groupTraits };\n }\n\n window.pendo.identify({ visitor: visitorObj, account: accountObj });\n }\n /*\n *Group call maps to an account for which visitor belongs.\n *It is same as identify call but here we send account object.\n */\n group(rudderElement) {\n let accountObj = {};\n let visitorObj = {};\n const { userId, traits } = rudderElement.message;\n accountObj.id = this.analytics.groupId || this.analytics.anonymousId;\n accountObj = {\n ...accountObj,\n ...traits,\n };\n\n if (userId) {\n visitorObj = {\n id: userId,\n ...(rudderElement.message.context &&\n rudderElement.message.context.traits),\n };\n }\n\n window.pendo.identify({ account: accountObj, visitor: visitorObj });\n }\n\n /* Once user is identified Pendo makes Track call to track user activity.\n */\n track(rudderElement) {\n const { event } = rudderElement.message;\n if (!event) {\n throw Error(\"Cannot call un-named track event\");\n }\n const props = rudderElement.message.properties;\n window.pendo.track(event, props);\n }\n}\n\nexport { Pendo };\n","/* eslint-disable class-methods-use-this */\n// disabled these for Lytics js tag\n/* eslint-disable no-plusplus */\n/* eslint-disable block-scoped-var */\n/* eslint-disable no-sequences */\n/* eslint-disable yoda */\n/* eslint-disable prefer-spread */\n// disabling these eslint which are caused by the Lytics js tag\n\n/* eslint-disable prefer-rest-params */\n/* eslint-disable no-var */\n/* eslint-disable vars-on-top */\n/* eslint-disable no-return-assign */\n/* eslint-disable no-shadow */\n/* eslint-disable no-void */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable one-var */\n/* eslint-disable lines-around-directive */\n/* eslint-disable strict */\nimport logger from \"../../utils/logUtil\";\n\nclass Lytics {\n constructor(config) {\n this.accountId = config.accountId;\n this.stream = config.stream;\n this.blockload = config.blockload;\n this.loadid = config.loadid;\n this.name = \"LYTICS\";\n }\n\n loadLyticsScript() {\n (function () {\n \"use strict\";\n var o = window.jstag || (window.jstag = {}),\n r = [];\n function n(e) {\n o[e] = function () {\n for (var n = arguments.length, t = new Array(n), i = 0; i < n; i++)\n t[i] = arguments[i];\n r.push([e, t]);\n };\n }\n n(\"send\"),\n n(\"mock\"),\n n(\"identify\"),\n n(\"pageView\"),\n n(\"unblock\"),\n n(\"getid\"),\n n(\"setid\"),\n n(\"loadEntity\"),\n n(\"getEntity\"),\n n(\"on\"),\n n(\"once\"),\n n(\"call\"),\n (o.loadScript = function (n, t, i) {\n var e = document.createElement(\"script\");\n (e.async = !0), (e.src = n), (e.onload = t), (e.onerror = i);\n var o = document.getElementsByTagName(\"script\")[0],\n r = (o && o.parentNode) || document.head || document.body,\n c = o || r.lastChild;\n return null != c ? r.insertBefore(e, c) : r.appendChild(e), this;\n }),\n (o.init = function n(t) {\n return (\n (this.config = t),\n this.loadScript(t.src, function () {\n if (o.init === n) throw new Error(\"Load error!\");\n // eslint-disable-next-line no-unused-expressions\n o.init(o.config),\n // eslint-disable-next-line func-names\n (function () {\n for (var n = 0; n < r.length; n++) {\n var t = r[n][0],\n i = r[n][1];\n o[t].apply(o, i);\n }\n r = void 0;\n })();\n }),\n this\n );\n });\n })();\n\n // Define config and initialize Lytics tracking tag.\n window.jstag.init({\n loadid: this.loadid,\n blocked: this.blockload,\n stream: this.stream,\n sessecs: 1800,\n src:\n document.location.protocal === \"https:\"\n ? `https://c.lytics.io/api/tag/${this.accountId}/latest.min.js`\n : `http://c.lytics.io/api/tag/${this.accountId}/latest.min.js`,\n });\n }\n\n init() {\n this.loadLyticsScript();\n logger.debug(\"===in init Lytics===\");\n }\n\n isLoaded() {\n logger.debug(\"in Lytics isLoaded\");\n logger.debug(\n !!(window.jstag && window.jstag.push !== Array.prototype.push)\n );\n return !!(window.jstag && window.jstag.push !== Array.prototype.push);\n }\n\n isReady() {\n logger.debug(\"in Lytics isReady\");\n return !!(window.jstag && window.jstag.push !== Array.prototype.push);\n }\n\n identify(rudderElement) {\n logger.debug(\"in Lytics identify\");\n // eslint-disable-next-line camelcase\n const user_id =\n rudderElement.message.userId || rudderElement.message.anonymousId;\n const { traits } = rudderElement.message.context;\n const payload = { user_id, ...traits };\n window.jstag.send(this.stream, payload);\n }\n\n page(rudderElement) {\n logger.debug(\"in Lytics page\");\n const { properties } = rudderElement.message;\n const payload = { event: rudderElement.message.name, ...properties };\n window.jstag.pageView(this.stream, payload);\n }\n\n track(rudderElement) {\n logger.debug(\"in Lytics track\");\n const { properties } = rudderElement.message;\n const payload = { _e: rudderElement.message.event, ...properties };\n window.jstag.send(this.stream, payload);\n }\n}\nexport default Lytics;\n","import logger from \"../../utils/logUtil\";\nimport ScriptLoader from \"../ScriptLoader\";\n\nclass Appcues {\n constructor(config) {\n this.accountId = config.accountId;\n this.apiKey = config.apiKey;\n this.name = \"APPCUES\";\n //this.sendToAllDestinations = config.sendToAll;\n }\n\n init() {\n logger.debug(\"===in init Appcues===\");\n ScriptLoader(\n \"appcues-id\",\n `https://fast.appcues.com/${this.accountId}.js`\n );\n }\n\n isLoaded() {\n logger.debug(\"in appcues isLoaded\");\n return !!window.Appcues;\n }\n\n isReady() {\n logger.debug(\"in appcues isReady\");\n // This block of code enables us to send Appcues Flow events to all the other destinations connected to the same source (we might use it in future)\n // if (this.sendToAllDestinations && window.Appcues) {\n // window.Appcues.on(\"all\", function(eventName, event) {\n // window.rudderanalytics.track(eventName, event, {\n // integrations: {\n // All: true,\n // APPCUES: false\n // }\n // });\n // });\n // }\n return !!window.Appcues;\n }\n\n identify(rudderElement) {\n const {\n traits\n } = rudderElement.message.context;\n const {\n userId\n } = rudderElement.message;\n if (userId) {\n window.Appcues.identify(userId, traits);\n } else {\n logger.error(\"user id is empty\");\n }\n }\n\n track(rudderElement) {\n const eventName = rudderElement.message.event;\n let {\n properties\n } = rudderElement.message;\n if (eventName) {\n window.Appcues.track(eventName, properties);\n } else {\n logger.error(\"event name is empty\");\n }\n }\n\n page(rudderElement) {\n const {\n properties,\n name\n } = rudderElement.message;\n window.Appcues.page(name, properties);\n }\n \n // To be uncommented after adding Reset feature to our SDK\n // reset() {\n // window.Appcues.reset();\n // }\n\n}\n\nexport default Appcues;","// Application class\nclass RudderApp {\n constructor() {\n this.build = \"1.0.0\";\n this.name = \"RudderLabs JavaScript SDK\";\n this.namespace = \"com.rudderlabs.javascript\";\n this.version = \"process.package_version\";\n }\n}\nexport default RudderApp;\n","// Library information class\nclass RudderLibraryInfo {\n constructor() {\n this.name = \"RudderLabs JavaScript SDK\";\n this.version = \"process.package_version\";\n }\n}\n// Operating System information class\nclass RudderOSInfo {\n constructor() {\n this.name = \"\";\n this.version = \"\";\n }\n}\n// Screen information class\nclass RudderScreenInfo {\n constructor() {\n this.density = 0;\n this.width = 0;\n this.height = 0;\n }\n}\n// Device information class\nclass RudderDeviceInfo {\n constructor() {\n this.id = \"\";\n this.manufacturer = \"\";\n this.model = \"\";\n this.name = \"\";\n }\n}\n// Carrier information\nclass RudderNetwork {\n constructor() {\n this.carrier = \"\";\n }\n}\nexport {\n RudderLibraryInfo,\n RudderOSInfo,\n RudderScreenInfo,\n RudderDeviceInfo,\n RudderNetwork,\n};\n","// Context class\nimport RudderApp from \"./RudderApp\";\nimport {\n RudderLibraryInfo,\n RudderOSInfo,\n RudderScreenInfo,\n} from \"./RudderInfo\";\n\nclass RudderContext {\n constructor() {\n this.app = new RudderApp();\n this.traits = null;\n this.library = new RudderLibraryInfo();\n // this.os = null;\n const os = new RudderOSInfo();\n os.version = \"\"; // skipping version for simplicity now\n const screen = new RudderScreenInfo();\n\n // Depending on environment within which the code is executing, screen\n // dimensions can be set\n // User agent and locale can be retrieved only for browser\n // For server-side integration, same needs to be set by calling program\n if (!process.browser) {\n // server-side integration\n screen.width = 0;\n screen.height = 0;\n screen.density = 0;\n os.version = \"\";\n os.name = \"\";\n this.userAgent = null;\n this.locale = null;\n } else {\n // running within browser\n screen.width = window.width;\n screen.height = window.height;\n screen.density = window.devicePixelRatio;\n this.userAgent = navigator.userAgent;\n // property name differs based on browser version\n this.locale = navigator.language || navigator.browserLanguage;\n }\n this.os = os;\n this.screen = screen;\n this.device = null;\n this.network = null;\n }\n}\nexport default RudderContext;\n","// Core message class with default values\nimport { generateUUID } from \"./utils\";\nimport { MessageType, ECommerceEvents } from \"./constants\";\nimport RudderContext from \"./RudderContext\";\n\nclass RudderMessage {\n constructor() {\n this.channel = \"web\";\n this.context = new RudderContext();\n this.type = null;\n this.action = null;\n this.messageId = generateUUID().toString();\n this.originalTimestamp = new Date().toISOString();\n this.anonymousId = null;\n this.userId = null;\n this.event = null;\n this.properties = {};\n this.integrations = {};\n // By default, all integrations will be set as enabled from client\n // Decision to route to specific destinations will be taken at server end\n this.integrations.All = true;\n }\n\n // Get property\n getProperty(key) {\n return this.properties[key];\n }\n\n // Add property\n addProperty(key, value) {\n this.properties[key] = value;\n }\n\n // Validate whether this message is semantically valid for the type mentioned\n validateFor(messageType) {\n // First check that properties is populated\n if (!this.properties) {\n throw new Error(\"Key properties is required\");\n }\n // Event type specific checks\n switch (messageType) {\n case MessageType.TRACK:\n // check if event is present\n if (!this.event) {\n throw new Error(\"Key event is required for track event\");\n }\n // Next make specific checks for e-commerce events\n if (this.event in Object.values(ECommerceEvents)) {\n switch (this.event) {\n case ECommerceEvents.CHECKOUT_STEP_VIEWED:\n case ECommerceEvents.CHECKOUT_STEP_COMPLETED:\n case ECommerceEvents.PAYMENT_INFO_ENTERED:\n this.checkForKey(\"checkout_id\");\n this.checkForKey(\"step\");\n break;\n case ECommerceEvents.PROMOTION_VIEWED:\n case ECommerceEvents.PROMOTION_CLICKED:\n this.checkForKey(\"promotion_id\");\n break;\n case ECommerceEvents.ORDER_REFUNDED:\n this.checkForKey(\"order_id\");\n break;\n default:\n }\n } else if (!this.properties.category) {\n // if category is not there, set to event\n this.properties.category = this.event;\n }\n\n break;\n case MessageType.PAGE:\n break;\n case MessageType.SCREEN:\n if (!this.properties.name) {\n throw new Error(\"Key 'name' is required in properties\");\n }\n break;\n }\n }\n\n // Function for checking existence of a particular property\n checkForKey(propertyName) {\n if (!this.properties[propertyName]) {\n throw new Error(`Key '${propertyName}' is required in properties`);\n }\n }\n}\nexport default RudderMessage;\n","import RudderMessage from \"./RudderMessage\";\n// Individual element class containing Rudder Message\nclass RudderElement {\n constructor() {\n this.message = new RudderMessage();\n }\n\n // Setters that in turn set the field values for the contained object\n setType(type) {\n this.message.type = type;\n }\n\n setProperty(rudderProperty) {\n this.message.properties = rudderProperty;\n }\n\n setUserProperty(rudderUserProperty) {\n this.message.user_properties = rudderUserProperty;\n }\n\n setUserId(userId) {\n this.message.userId = userId;\n }\n\n setEventName(eventName) {\n this.message.event = eventName;\n }\n\n updateTraits(traits) {\n this.message.context.traits = traits;\n }\n\n getElementContent() {\n return this.message;\n }\n}\nexport default RudderElement;\n","// Class responsible for building up the individual elements in a batch\n// that is transmitted by the SDK\nimport RudderElement from \"./RudderElement.js\";\n\nclass RudderElementBuilder {\n constructor() {\n this.rudderProperty = null;\n this.rudderUserProperty = null;\n this.event = null;\n this.userId = null;\n this.channel = null;\n this.type = null;\n }\n\n // Set the property\n setProperty(inputRudderProperty) {\n this.rudderProperty = inputRudderProperty;\n return this;\n }\n\n // Build and set the property object\n setPropertyBuilder(rudderPropertyBuilder) {\n this.rudderProperty = rudderPropertyBuilder.build();\n return this;\n }\n\n setUserProperty(inputRudderUserProperty) {\n this.rudderUserProperty = inputRudderUserProperty;\n return this;\n }\n\n setUserPropertyBuilder(rudderUserPropertyBuilder) {\n this.rudderUserProperty = rudderUserPropertyBuilder.build();\n return this;\n }\n\n // Setter methods for all variables. Instance is returned for each call in\n // accordance with the Builder pattern\n\n setEvent(event) {\n this.event = event;\n return this;\n }\n\n setUserId(userId) {\n this.userId = userId;\n return this;\n }\n\n setChannel(channel) {\n this.channel = channel;\n return this;\n }\n\n setType(eventType) {\n this.type = eventType;\n return this;\n }\n\n build() {\n const element = new RudderElement();\n element.setUserId(this.userId);\n element.setType(this.type);\n element.setEventName(this.event);\n element.setProperty(this.rudderProperty);\n element.setUserProperty(this.rudderUserProperty);\n return element;\n }\n}\nexport default RudderElementBuilder;\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`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;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // 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 if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n 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 }\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 var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\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;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\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;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\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\nvar defaultEngine = require('./engine').defaultEngine;\nvar inMemoryEngine = require('./engine').inMemoryEngine;\nvar each = require('@ndhoule/each');\nvar keys = require('@ndhoule/keys');\nvar json = require('json3');\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}\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* 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 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\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) {\n var id = this.nextId++;\n this.tasks[id] = clock.setTimeout(this._handle(id, task), 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) {\n var self = this;\n return function() {\n delete self.tasks[id];\n return callback();\n };\n};\n\nSchedule.setClock = function(newClock) {\n clock = newClock;\n};\n\nSchedule.resetClock = function() {\n clock = defaultClock;\n};\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('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 {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 ACK: 'ack',\n RECLAIM_START: 'reclaimStart',\n RECLAIM_END: 'reclaimEnd'\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 });\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 */\nQueue.prototype.requeue = function(item, attemptNumber, error) {\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 });\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);\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);\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);\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);\n }, self.timeouts.RECLAIM_WAIT);\n }\n\n function findOtherQueues(name) {\n var res = [];\n var storage = self._store.engine;\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);\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 // add their queue to ours, resetting run-time to immediate and copying the attempt#\n each(function(el) {\n our.queue.push({\n item: el.item,\n attemptNumber: el.attemptNumber,\n time: self._schedule.now()\n });\n }, their.queue);\n\n // if the queue is abandoned, all the in-progress are failed. retry them immediately and increment the attempt#\n each(function(el) {\n our.queue.push({\n item: el.item,\n attemptNumber: el.attemptNumber + 1,\n time: self._schedule.now()\n });\n }, their.inProgress);\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.ACK);\n other.remove(this.keys.RECLAIM_START);\n other.remove(this.keys.RECLAIM_END);\n other.remove(this.keys.IN_PROGRESS);\n other.remove(this.keys.QUEUE);\n\n // process the new items we claimed\n this._processHead();\n};\n\nmodule.exports = Queue;\n","// Payload class, contains batch of Elements\nclass RudderPayload {\n constructor() {\n this.batch = null;\n this.writeKey = null;\n }\n}\nexport { RudderPayload };\n","import Queue from \"@segment/localstorage-retry\";\nimport {\n BASE_URL,\n FLUSH_QUEUE_SIZE,\n FLUSH_INTERVAL_DEFAULT,\n} from \"./constants\";\nimport { getCurrentTimeFormatted, handleError, replacer } from \"./utils\";\n\nimport { RudderPayload } from \"./RudderPayload\";\nimport logger from \"./logUtil\";\n// import * as XMLHttpRequestNode from \"Xmlhttprequest\";\n\nlet XMLHttpRequestNode;\nif (!process.browser) {\n XMLHttpRequestNode = require(\"Xmlhttprequest\");\n}\n\nlet btoaNode;\nif (!process.browser) {\n btoaNode = require(\"btoa\");\n}\n\nconst queueOptions = {\n maxRetryDelay: 360000,\n minRetryDelay: 1000,\n backoffFactor: 2,\n maxAttempts: 10,\n maxItems: 100,\n};\n\nconst MESSAGE_LENGTH = 32 * 1000; // ~32 Kb\n\n/**\n *\n * @class EventRepository responsible for adding events into\n * flush queue and sending data to rudder backend\n * in batch and maintains order of the event.\n */\nclass EventRepository {\n /**\n *Creates an instance of EventRepository.\n * @memberof EventRepository\n */\n constructor(options) {\n this.eventsBuffer = [];\n this.writeKey = \"\";\n this.url = \"\";\n this.state = \"READY\";\n this.batchSize = 0;\n\n // previous implementation\n // setInterval(this.preaparePayloadAndFlush, FLUSH_INTERVAL_DEFAULT, this);\n }\n\n startQueue(options) {\n if (options) {\n // TODO: add checks for value - has to be +ve?\n Object.assign(queueOptions, options);\n }\n this.payloadQueue = new Queue(\"rudder\", queueOptions, function (\n item,\n done\n ) {\n // apply sentAt at flush time and reset on each retry\n item.message.sentAt = getCurrentTimeFormatted();\n // send this item for processing, with a callback to enable queue to get the done status\n eventRepository.processQueueElement(\n item.url,\n item.headers,\n item.message,\n 10 * 1000,\n function (err, res) {\n if (err) {\n return done(err);\n }\n done(null, res);\n }\n );\n });\n\n // start queue\n this.payloadQueue.start();\n }\n\n /**\n *\n *\n * @param {EventRepository} repo\n * @returns\n * @memberof EventRepository\n */\n preaparePayloadAndFlush(repo) {\n // construct payload\n logger.debug(`==== in preaparePayloadAndFlush with state: ${repo.state}`);\n logger.debug(repo.eventsBuffer);\n if (repo.eventsBuffer.length == 0 || repo.state === \"PROCESSING\") {\n return;\n }\n const eventsPayload = repo.eventsBuffer;\n const payload = new RudderPayload();\n payload.batch = eventsPayload;\n payload.writeKey = repo.writeKey;\n payload.sentAt = getCurrentTimeFormatted();\n\n // add sentAt to individual events as well\n payload.batch.forEach((event) => {\n event.sentAt = payload.sentAt;\n });\n\n repo.batchSize = repo.eventsBuffer.length;\n // server-side integration, XHR is node module\n\n if (process.browser) {\n var xhr = new XMLHttpRequest();\n } else {\n var xhr = new XMLHttpRequestNode.XMLHttpRequest();\n }\n\n logger.debug(\"==== in flush sending to Rudder BE ====\");\n logger.debug(JSON.stringify(payload, replacer));\n\n xhr.open(\"POST\", repo.url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n\n if (process.browser) {\n xhr.setRequestHeader(\n \"Authorization\",\n `Basic ${btoa(`${payload.writeKey}:`)}`\n );\n } else {\n xhr.setRequestHeader(\n \"Authorization\",\n `Basic ${btoaNode(`${payload.writeKey}:`)}`\n );\n }\n\n // register call back to reset event buffer on successfull POST\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && xhr.status === 200) {\n logger.debug(`====== request processed successfully: ${xhr.status}`);\n repo.eventsBuffer = repo.eventsBuffer.slice(repo.batchSize);\n logger.debug(repo.eventsBuffer.length);\n } else if (xhr.readyState === 4 && xhr.status !== 200) {\n handleError(\n new Error(\n `request failed with status: ${xhr.status} for url: ${repo.url}`\n )\n );\n }\n repo.state = \"READY\";\n };\n xhr.send(JSON.stringify(payload, replacer));\n repo.state = \"PROCESSING\";\n }\n\n /**\n * the queue item proceesor\n * @param {*} url to send requests to\n * @param {*} headers\n * @param {*} message\n * @param {*} timeout\n * @param {*} queueFn the function to call after request completion\n */\n processQueueElement(url, headers, message, timeout, queueFn) {\n try {\n const xhr = new XMLHttpRequest();\n xhr.open(\"POST\", url, true);\n for (const k in headers) {\n xhr.setRequestHeader(k, headers[k]);\n }\n xhr.timeout = timeout;\n xhr.ontimeout = queueFn;\n xhr.onerror = queueFn;\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 429 || (xhr.status >= 500 && xhr.status < 600)) {\n handleError(\n new Error(\n `request failed with status: ${xhr.status}${xhr.statusText} for url: ${url}`\n )\n );\n queueFn(\n new Error(\n `request failed with status: ${xhr.status}${xhr.statusText} for url: ${url}`\n )\n );\n } else {\n logger.debug(\n `====== request processed successfully: ${xhr.status}`\n );\n queueFn(null, xhr.status);\n }\n }\n };\n\n xhr.send(JSON.stringify(message, replacer));\n } catch (error) {\n queueFn(error);\n }\n }\n\n /**\n *\n *\n * @param {RudderElement} rudderElement\n * @memberof EventRepository\n */\n enqueue(rudderElement, type) {\n const message = rudderElement.getElementContent();\n\n const headers = {\n \"Content-Type\": \"application/json\",\n Authorization: `Basic ${btoa(`${this.writeKey}:`)}`,\n AnonymousId: btoa(message.anonymousId),\n };\n\n message.originalTimestamp = getCurrentTimeFormatted();\n message.sentAt = getCurrentTimeFormatted(); // add this, will get modified when actually being sent\n\n // check message size, if greater log an error\n if (JSON.stringify(message).length > MESSAGE_LENGTH) {\n logger.error(\n \"[EventRepository] enqueue:: message length greater 32 Kb \",\n message\n );\n }\n\n // modify the url for event specific endpoints\n const url = this.url.slice(-1) == \"/\" ? this.url.slice(0, -1) : this.url;\n // add items to the queue\n this.payloadQueue.addItem({\n url: `${url}/v1/${type}`,\n headers,\n message,\n });\n }\n}\nlet eventRepository = new EventRepository();\nexport { eventRepository as EventRepository };\n","import logger from \"./logUtil\";\n\nfunction addDomEventHandlers(rudderanalytics) {\n logger.error(\n \"[AutoTrack]: This functionality has been moved to a different deployment\"\n );\n}\nexport { addDomEventHandlers };\n","/* eslint-disable new-cap */\n/* eslint-disable func-names */\n/* eslint-disable eqeqeq */\n/* eslint-disable no-prototype-builtins */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable guard-for-in */\n/* eslint-disable no-sequences */\n/* eslint-disable no-multi-assign */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable import/extensions */\n/* eslint-disable no-param-reassign */\nimport Emitter from \"component-emitter\";\nimport after from \"after\";\nimport querystring from \"component-querystring\";\nimport merge from \"lodash.merge\";\nimport utm from \"@segment/utm-params\";\nimport {\n getJSONTrimmed,\n generateUUID,\n handleError,\n getDefaultPageProperties,\n getUserProvidedConfigUrl,\n findAllEnabledDestinations,\n tranformToRudderNames,\n transformToServerNames,\n} from \"./utils/utils\";\nimport {\n CONFIG_URL,\n MAX_WAIT_FOR_INTEGRATION_LOAD,\n INTEGRATION_LOAD_CHECK_INTERVAL,\n} from \"./utils/constants\";\nimport { integrations } from \"./integrations\";\nimport RudderElementBuilder from \"./utils/RudderElementBuilder\";\nimport Storage from \"./utils/storage\";\nimport { EventRepository } from \"./utils/EventRepository\";\nimport logger from \"./utils/logUtil\";\nimport { addDomEventHandlers } from \"./utils/autotrack.js\";\nimport ScriptLoader from \"./integrations/ScriptLoader\";\n\nconst queryDefaults = {\n trait: \"ajs_trait_\",\n prop: \"ajs_prop_\",\n};\n\n// https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js\n\n/**\n * Add the rudderelement object to flush queue\n *\n * @param {RudderElement} rudderElement\n */\nfunction enqueue(rudderElement, type) {\n if (!this.eventRepository) {\n this.eventRepository = EventRepository;\n }\n this.eventRepository.enqueue(rudderElement, type);\n}\n\n/**\n * class responsible for handling core\n * event tracking functionalities\n */\nclass Analytics {\n /**\n * Creates an instance of Analytics.\n * @memberof Analytics\n */\n constructor() {\n this.autoTrackHandlersRegistered = false;\n this.autoTrackFeatureEnabled = false;\n this.initialized = false;\n this.trackValues = [];\n this.eventsBuffer = [];\n this.clientIntegrations = [];\n this.loadOnlyIntegrations = {};\n this.clientIntegrationObjects = undefined;\n this.successfullyLoadedIntegration = [];\n this.failedToBeLoadedIntegration = [];\n this.toBeProcessedArray = [];\n this.toBeProcessedByIntegrationArray = [];\n this.storage = Storage;\n this.eventRepository = EventRepository;\n this.sendAdblockPage = false;\n this.sendAdblockPageOptions = {};\n this.clientSuppliedCallbacks = {};\n this.readyCallback = () => {};\n this.executeReadyCallback = undefined;\n this.methodToCallbackMapping = {\n syncPixel: \"syncPixelCallback\",\n };\n this.loaded = false;\n }\n\n /**\n * initialize the user after load config\n */\n initializeUser() {\n this.userId =\n this.storage.getUserId() != undefined ? this.storage.getUserId() : \"\";\n\n this.userTraits =\n this.storage.getUserTraits() != undefined\n ? this.storage.getUserTraits()\n : {};\n\n this.groupId =\n this.storage.getGroupId() != undefined ? this.storage.getGroupId() : \"\";\n\n this.groupTraits =\n this.storage.getGroupTraits() != undefined\n ? this.storage.getGroupTraits()\n : {};\n\n this.anonymousId = this.getAnonymousId();\n\n // save once for storing older values to encrypted\n this.storage.setUserId(this.userId);\n this.storage.setAnonymousId(this.anonymousId);\n this.storage.setGroupId(this.groupId);\n this.storage.setUserTraits(this.userTraits);\n this.storage.setGroupTraits(this.groupTraits);\n }\n\n /**\n * Process the response from control plane and\n * call initialize for integrations\n *\n * @param {*} status\n * @param {*} response\n * @memberof Analytics\n */\n processResponse(status, response) {\n try {\n logger.debug(`===in process response=== ${status}`);\n response = JSON.parse(response);\n if (\n response.source.useAutoTracking &&\n !this.autoTrackHandlersRegistered\n ) {\n this.autoTrackFeatureEnabled = true;\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n }\n response.source.destinations.forEach(function (destination, index) {\n logger.debug(\n `Destination ${index} Enabled? ${destination.enabled} Type: ${destination.destinationDefinition.name} Use Native SDK? ${destination.config.useNativeSDK}`\n );\n if (destination.enabled) {\n this.clientIntegrations.push({\n name: destination.destinationDefinition.name,\n config: destination.config,\n });\n }\n }, this);\n\n logger.debug(\"this.clientIntegrations: \", this.clientIntegrations);\n // intersection of config-plane native sdk destinations with sdk load time destination list\n this.clientIntegrations = findAllEnabledDestinations(\n this.loadOnlyIntegrations,\n this.clientIntegrations\n );\n\n // remove from the list which don't have support yet in SDK\n this.clientIntegrations = this.clientIntegrations.filter((intg) => {\n return integrations[intg.name] != undefined;\n });\n\n this.init(this.clientIntegrations);\n } catch (error) {\n handleError(error);\n logger.debug(\"===handling config BE response processing error===\");\n logger.debug(\n \"autoTrackHandlersRegistered\",\n this.autoTrackHandlersRegistered\n );\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n }\n }\n }\n\n /**\n * Initialize integrations by addinfg respective scripts\n * keep the instances reference in core\n *\n * @param {*} intgArray\n * @returns\n * @memberof Analytics\n */\n init(intgArray) {\n const self = this;\n logger.debug(\"supported intgs \", integrations);\n // this.clientIntegrationObjects = [];\n\n if (!intgArray || intgArray.length == 0) {\n if (this.readyCallback) {\n this.readyCallback();\n }\n this.toBeProcessedByIntegrationArray = [];\n return;\n }\n\n intgArray.forEach((intg) => {\n try {\n logger.debug(\n \"[Analytics] init :: trying to initialize integration name:: \",\n intg.name\n );\n const intgClass = integrations[intg.name];\n const destConfig = intg.config;\n const intgInstance = new intgClass(destConfig, self);\n intgInstance.init();\n\n logger.debug(\"initializing destination: \", intg);\n\n this.isInitialized(intgInstance).then(this.replayEvents);\n } catch (e) {\n logger.error(\n \"[Analytics] initialize integration (integration.init()) failed :: \",\n intg.name\n );\n }\n });\n }\n\n // eslint-disable-next-line class-methods-use-this\n replayEvents(object) {\n if (\n object.successfullyLoadedIntegration.length +\n object.failedToBeLoadedIntegration.length ===\n object.clientIntegrations.length\n ) {\n logger.debug(\n \"===replay events called====\",\n object.successfullyLoadedIntegration.length,\n object.failedToBeLoadedIntegration.length\n );\n // eslint-disable-next-line no-param-reassign\n object.clientIntegrationObjects = [];\n // eslint-disable-next-line no-param-reassign\n object.clientIntegrationObjects = object.successfullyLoadedIntegration;\n\n logger.debug(\n \"==registering after callback===\",\n object.clientIntegrationObjects.length\n );\n object.executeReadyCallback = after(\n object.clientIntegrationObjects.length,\n object.readyCallback\n );\n\n logger.debug(\"==registering ready callback===\");\n object.on(\"ready\", object.executeReadyCallback);\n\n object.clientIntegrationObjects.forEach((intg) => {\n logger.debug(\"===looping over each successful integration====\");\n if (!intg.isReady || intg.isReady()) {\n logger.debug(\"===letting know I am ready=====\", intg.name);\n object.emit(\"ready\");\n }\n });\n\n if (object.toBeProcessedByIntegrationArray.length > 0) {\n // send the queued events to the fetched integration\n object.toBeProcessedByIntegrationArray.forEach((event) => {\n const methodName = event[0];\n event.shift();\n\n // convert common names to sdk identified name\n if (Object.keys(event[0].message.integrations).length > 0) {\n tranformToRudderNames(event[0].message.integrations);\n }\n\n // if not specified at event level, All: true is default\n const clientSuppliedIntegrations = event[0].message.integrations;\n\n // get intersection between config plane native enabled destinations\n // (which were able to successfully load on the page) vs user supplied integrations\n const succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(\n clientSuppliedIntegrations,\n object.clientIntegrationObjects\n );\n\n // send to all integrations now from the 'toBeProcessedByIntegrationArray' replay queue\n for (\n let i = 0;\n i < succesfulLoadedIntersectClientSuppliedIntegrations.length;\n i += 1\n ) {\n try {\n if (\n !succesfulLoadedIntersectClientSuppliedIntegrations[i]\n .isFailed ||\n !succesfulLoadedIntersectClientSuppliedIntegrations[\n i\n ].isFailed()\n ) {\n if (\n succesfulLoadedIntersectClientSuppliedIntegrations[i][\n methodName\n ]\n ) {\n succesfulLoadedIntersectClientSuppliedIntegrations[i][\n methodName\n ](...event);\n }\n }\n } catch (error) {\n handleError(error);\n }\n }\n });\n object.toBeProcessedByIntegrationArray = [];\n }\n }\n }\n\n pause(time) {\n return new Promise((resolve) => {\n setTimeout(resolve, time);\n });\n }\n\n isInitialized(instance, time = 0) {\n return new Promise((resolve) => {\n if (instance.isLoaded()) {\n logger.debug(\"===integration loaded successfully====\", instance.name);\n this.successfullyLoadedIntegration.push(instance);\n return resolve(this);\n }\n if (time >= MAX_WAIT_FOR_INTEGRATION_LOAD) {\n logger.debug(\"====max wait over====\");\n this.failedToBeLoadedIntegration.push(instance);\n return resolve(this);\n }\n\n this.pause(INTEGRATION_LOAD_CHECK_INTERVAL).then(() => {\n logger.debug(\"====after pause, again checking====\");\n return this.isInitialized(\n instance,\n time + INTEGRATION_LOAD_CHECK_INTERVAL\n ).then(resolve);\n });\n });\n }\n\n /**\n * Process page params and forward to page call\n *\n * @param {*} category\n * @param {*} name\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n page(category, name, properties, options, callback) {\n if (!this.loaded) return;\n if (typeof options === \"function\") (callback = options), (options = null);\n if (typeof properties === \"function\")\n (callback = properties), (options = properties = null);\n if (typeof name === \"function\")\n (callback = name), (options = properties = name = null);\n if (\n typeof category === \"object\" &&\n category != null &&\n category != undefined\n )\n (options = name), (properties = category), (name = category = null);\n if (typeof name === \"object\" && name != null && name != undefined)\n (options = properties), (properties = name), (name = null);\n if (typeof category === \"string\" && typeof name !== \"string\")\n (name = category), (category = null);\n if (this.sendAdblockPage && category != \"RudderJS-Initiated\") {\n this.sendSampleRequest();\n }\n this.processPage(category, name, properties, options, callback);\n }\n\n /**\n * Process track params and forward to track call\n *\n * @param {*} event\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n track(event, properties, options, callback) {\n if (!this.loaded) return;\n if (typeof options === \"function\") (callback = options), (options = null);\n if (typeof properties === \"function\")\n (callback = properties), (options = null), (properties = null);\n\n this.processTrack(event, properties, options, callback);\n }\n\n /**\n * Process identify params and forward to indentify call\n *\n * @param {*} userId\n * @param {*} traits\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n identify(userId, traits, options, callback) {\n if (!this.loaded) return;\n if (typeof options === \"function\") (callback = options), (options = null);\n if (typeof traits === \"function\")\n (callback = traits), (options = null), (traits = null);\n if (typeof userId === \"object\")\n (options = traits), (traits = userId), (userId = this.userId);\n\n this.processIdentify(userId, traits, options, callback);\n }\n\n /**\n *\n * @param {*} to\n * @param {*} from\n * @param {*} options\n * @param {*} callback\n */\n alias(to, from, options, callback) {\n if (!this.loaded) return;\n if (typeof options === \"function\") (callback = options), (options = null);\n if (typeof from === \"function\")\n (callback = from), (options = null), (from = null);\n if (typeof from === \"object\") (options = from), (from = null);\n\n const rudderElement = new RudderElementBuilder().setType(\"alias\").build();\n rudderElement.message.previousId =\n from || (this.userId ? this.userId : this.getAnonymousId());\n rudderElement.message.userId = to;\n\n this.processAndSendDataToDestinations(\n \"alias\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n *\n * @param {*} to\n * @param {*} from\n * @param {*} options\n * @param {*} callback\n */\n group(groupId, traits, options, callback) {\n if (!this.loaded) return;\n if (!arguments.length) return;\n\n if (typeof options === \"function\") (callback = options), (options = null);\n if (typeof traits === \"function\")\n (callback = traits), (options = null), (traits = null);\n if (typeof groupId === \"object\")\n (options = traits), (traits = groupId), (groupId = this.groupId);\n\n this.groupId = groupId;\n this.storage.setGroupId(this.groupId);\n\n const rudderElement = new RudderElementBuilder().setType(\"group\").build();\n if (traits) {\n for (const key in traits) {\n this.groupTraits[key] = traits[key];\n }\n } else {\n this.groupTraits = {};\n }\n this.storage.setGroupTraits(this.groupTraits);\n\n this.processAndSendDataToDestinations(\n \"group\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Send page call to Rudder BE and to initialized integrations\n *\n * @param {*} category\n * @param {*} name\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processPage(category, name, properties, options, callback) {\n const rudderElement = new RudderElementBuilder().setType(\"page\").build();\n if (!properties) {\n properties = {};\n }\n if (name) {\n rudderElement.message.name = name;\n properties.name = name;\n }\n if (category) {\n rudderElement.message.category = category;\n properties.category = category;\n }\n rudderElement.message.properties = this.getPageProperties(properties); // properties;\n\n this.trackPage(rudderElement, options, callback);\n }\n\n /**\n * Send track call to Rudder BE and to initialized integrations\n *\n * @param {*} event\n * @param {*} properties\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processTrack(event, properties, options, callback) {\n const rudderElement = new RudderElementBuilder().setType(\"track\").build();\n if (event) {\n rudderElement.setEventName(event);\n }\n if (properties) {\n rudderElement.setProperty(properties);\n } else {\n rudderElement.setProperty({});\n }\n\n this.trackEvent(rudderElement, options, callback);\n }\n\n /**\n * Send identify call to Rudder BE and to initialized integrations\n *\n * @param {*} userId\n * @param {*} traits\n * @param {*} options\n * @param {*} callback\n * @memberof Analytics\n */\n processIdentify(userId, traits, options, callback) {\n if (userId && this.userId && userId !== this.userId) {\n this.reset();\n }\n this.userId = userId;\n this.storage.setUserId(this.userId);\n\n const rudderElement = new RudderElementBuilder()\n .setType(\"identify\")\n .build();\n if (traits) {\n for (const key in traits) {\n this.userTraits[key] = traits[key];\n }\n this.storage.setUserTraits(this.userTraits);\n }\n\n this.identifyUser(rudderElement, options, callback);\n }\n\n /**\n * Identify call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n identifyUser(rudderElement, options, callback) {\n if (rudderElement.message.userId) {\n this.userId = rudderElement.message.userId;\n this.storage.setUserId(this.userId);\n }\n\n if (\n rudderElement &&\n rudderElement.message &&\n rudderElement.message.context &&\n rudderElement.message.context.traits\n ) {\n this.userTraits = {\n ...rudderElement.message.context.traits,\n };\n this.storage.setUserTraits(this.userTraits);\n }\n\n this.processAndSendDataToDestinations(\n \"identify\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Page call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n trackPage(rudderElement, options, callback) {\n this.processAndSendDataToDestinations(\n \"page\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Track call supporting rudderelement from builder\n *\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n trackEvent(rudderElement, options, callback) {\n this.processAndSendDataToDestinations(\n \"track\",\n rudderElement,\n options,\n callback\n );\n }\n\n /**\n * Process and send data to destinations along with rudder BE\n *\n * @param {*} type\n * @param {*} rudderElement\n * @param {*} callback\n * @memberof Analytics\n */\n processAndSendDataToDestinations(type, rudderElement, options, callback) {\n try {\n if (!this.anonymousId) {\n this.setAnonymousId();\n }\n\n // assign page properties to context\n // rudderElement.message.context.page = getDefaultPageProperties();\n\n rudderElement.message.context.traits = {\n ...this.userTraits,\n };\n\n logger.debug(\"anonymousId: \", this.anonymousId);\n rudderElement.message.anonymousId = this.anonymousId;\n rudderElement.message.userId = rudderElement.message.userId\n ? rudderElement.message.userId\n : this.userId;\n\n if (type == \"group\") {\n if (this.groupId) {\n rudderElement.message.groupId = this.groupId;\n }\n if (this.groupTraits) {\n rudderElement.message.traits = {\n ...this.groupTraits,\n };\n }\n }\n\n this.processOptionsParam(rudderElement, options);\n logger.debug(JSON.stringify(rudderElement));\n\n // structure user supplied integrations object to rudder format\n if (Object.keys(rudderElement.message.integrations).length > 0) {\n tranformToRudderNames(rudderElement.message.integrations);\n }\n\n // if not specified at event level, All: true is default\n const clientSuppliedIntegrations = rudderElement.message.integrations;\n\n // get intersection between config plane native enabled destinations\n // (which were able to successfully load on the page) vs user supplied integrations\n const succesfulLoadedIntersectClientSuppliedIntegrations = findAllEnabledDestinations(\n clientSuppliedIntegrations,\n this.clientIntegrationObjects\n );\n\n // try to first send to all integrations, if list populated from BE\n try {\n succesfulLoadedIntersectClientSuppliedIntegrations.forEach((obj) => {\n if (!obj.isFailed || !obj.isFailed()) {\n if (obj[type]) {\n obj[type](rudderElement);\n }\n }\n });\n } catch (err) {\n handleError({ message: `[sendToNative]:${err}` });\n }\n\n // config plane native enabled destinations, still not completely loaded\n // in the page, add the events to a queue and process later\n if (!this.clientIntegrationObjects) {\n logger.debug(\"pushing in replay queue\");\n // new event processing after analytics initialized but integrations not fetched from BE\n this.toBeProcessedByIntegrationArray.push([type, rudderElement]);\n }\n\n // convert integrations object to server identified names, kind of hack now!\n transformToServerNames(rudderElement.message.integrations);\n\n // self analytics process, send to rudder\n enqueue.call(this, rudderElement, type);\n\n logger.debug(`${type} is called `);\n if (callback) {\n callback();\n }\n } catch (error) {\n handleError(error);\n }\n }\n\n /**\n * add campaign parsed details under context\n * @param {*} rudderElement\n */\n addCampaignInfo(rudderElement) {\n const { search } = getDefaultPageProperties();\n const campaign = utm(search);\n if (\n rudderElement.message.context &&\n typeof rudderElement.message.context === \"object\"\n ) {\n rudderElement.message.context.campaign = campaign;\n }\n }\n\n /**\n * process options parameter\n * Apart from top level keys merge everyting under context\n * context.page's default properties are overriden by same keys of\n * provided properties in case of page call\n *\n * @param {*} rudderElement\n * @param {*} options\n * @memberof Analytics\n */\n processOptionsParam(rudderElement, options) {\n const { type, properties } = rudderElement.message;\n\n this.addCampaignInfo(rudderElement);\n\n // assign page properties to context.page\n rudderElement.message.context.page =\n type == \"page\"\n ? this.getContextPageProperties(properties)\n : this.getContextPageProperties();\n\n const toplevelElements = [\n \"integrations\",\n \"anonymousId\",\n \"originalTimestamp\",\n ];\n for (const key in options) {\n if (toplevelElements.includes(key)) {\n rudderElement.message[key] = options[key];\n } else if (key !== \"context\") {\n rudderElement.message.context = merge(rudderElement.message.context, {\n [key]: options[key],\n });\n } else if (typeof options[key] === \"object\" && options[key] != null) {\n rudderElement.message.context = merge(rudderElement.message.context, {\n ...options[key],\n });\n } else {\n logger.error(\n \"[Analytics: processOptionsParam] context passed in options is not object\"\n );\n }\n }\n }\n\n getPageProperties(properties, options) {\n const defaultPageProperties = getDefaultPageProperties();\n const optionPageProperties = options && options.page ? options.page : {};\n for (const key in defaultPageProperties) {\n if (properties[key] === undefined) {\n properties[key] =\n optionPageProperties[key] || defaultPageProperties[key];\n }\n }\n return properties;\n }\n\n // Assign page properties to context.page if the same property is not provided under context.page\n getContextPageProperties(properties) {\n const defaultPageProperties = getDefaultPageProperties();\n const contextPageProperties = {};\n for (const key in defaultPageProperties) {\n contextPageProperties[key] =\n properties && properties[key]\n ? properties[key]\n : defaultPageProperties[key];\n }\n return contextPageProperties;\n }\n\n /**\n * Clear user information\n *\n * @memberof Analytics\n */\n reset() {\n if (!this.loaded) return;\n this.userId = \"\";\n this.userTraits = {};\n this.groupId = \"\";\n this.groupTraits = {};\n this.storage.clear();\n }\n\n getAnonymousId() {\n // if (!this.loaded) return;\n this.anonymousId = this.storage.getAnonymousId();\n if (!this.anonymousId) {\n this.setAnonymousId();\n }\n return this.anonymousId;\n }\n\n setAnonymousId(anonymousId) {\n // if (!this.loaded) return;\n this.anonymousId = anonymousId || generateUUID();\n this.storage.setAnonymousId(this.anonymousId);\n }\n\n isValidWriteKey(writeKey) {\n if (\n !writeKey ||\n typeof writeKey !== \"string\" ||\n writeKey.trim().length == 0\n ) {\n return false;\n }\n return true;\n }\n\n isValidServerUrl(serverUrl) {\n if (\n !serverUrl ||\n typeof serverUrl !== \"string\" ||\n serverUrl.trim().length == 0\n ) {\n return false;\n }\n return true;\n }\n\n /**\n * Call control pane to get client configs\n *\n * @param {*} writeKey\n * @memberof Analytics\n */\n load(writeKey, serverUrl, options) {\n logger.debug(\"inside load \");\n if (this.loaded) return;\n let configUrl = CONFIG_URL;\n if (!this.isValidWriteKey(writeKey) || !this.isValidServerUrl(serverUrl)) {\n handleError({\n message:\n \"[Analytics] load:: Unable to load due to wrong writeKey or serverUrl\",\n });\n throw Error(\"failed to initialize\");\n }\n if (options && options.logLevel) {\n logger.setLogLevel(options.logLevel);\n }\n if (options && options.integrations) {\n Object.assign(this.loadOnlyIntegrations, options.integrations);\n tranformToRudderNames(this.loadOnlyIntegrations);\n }\n if (options && options.configUrl) {\n configUrl = getUserProvidedConfigUrl(options.configUrl);\n }\n if (options && options.sendAdblockPage) {\n this.sendAdblockPage = true;\n }\n if (options && options.sendAdblockPageOptions) {\n if (typeof options.sendAdblockPageOptions === \"object\") {\n this.sendAdblockPageOptions = options.sendAdblockPageOptions;\n }\n }\n if (options && options.clientSuppliedCallbacks) {\n // convert to rudder recognised method names\n const tranformedCallbackMapping = {};\n Object.keys(this.methodToCallbackMapping).forEach((methodName) => {\n if (this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n if (\n options.clientSuppliedCallbacks[\n this.methodToCallbackMapping[methodName]\n ]\n ) {\n tranformedCallbackMapping[methodName] =\n options.clientSuppliedCallbacks[\n this.methodToCallbackMapping[methodName]\n ];\n }\n }\n });\n Object.assign(this.clientSuppliedCallbacks, tranformedCallbackMapping);\n this.registerCallbacks(true);\n }\n\n if (\n options &&\n options.queueOptions &&\n options.queueOptions != null &&\n typeof options.queueOptions == \"object\"\n ) {\n this.eventRepository.startQueue(options.queueOptions);\n } else {\n this.eventRepository.startQueue({});\n }\n\n this.eventRepository.writeKey = writeKey;\n if (serverUrl) {\n this.eventRepository.url = serverUrl;\n }\n this.initializeUser();\n this.loaded = true;\n if (\n options &&\n options.valTrackingList &&\n options.valTrackingList.push == Array.prototype.push\n ) {\n this.trackValues = options.valTrackingList;\n }\n if (options && options.useAutoTracking) {\n this.autoTrackFeatureEnabled = true;\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(this);\n this.autoTrackHandlersRegistered = true;\n logger.debug(\n \"autoTrackHandlersRegistered\",\n this.autoTrackHandlersRegistered\n );\n }\n }\n try {\n getJSONTrimmed(this, configUrl, writeKey, this.processResponse);\n } catch (error) {\n handleError(error);\n if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) {\n addDomEventHandlers(this);\n }\n }\n }\n\n ready(callback) {\n if (!this.loaded) return;\n if (typeof callback === \"function\") {\n this.readyCallback = callback;\n return;\n }\n logger.error(\"ready callback is not a function\");\n }\n\n initializeCallbacks() {\n Object.keys(this.methodToCallbackMapping).forEach((methodName) => {\n if (this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n this.on(methodName, () => {});\n }\n });\n }\n\n registerCallbacks(calledFromLoad) {\n if (!calledFromLoad) {\n Object.keys(this.methodToCallbackMapping).forEach((methodName) => {\n if (this.methodToCallbackMapping.hasOwnProperty(methodName)) {\n if (window.rudderanalytics) {\n if (\n typeof window.rudderanalytics[\n this.methodToCallbackMapping[methodName]\n ] === \"function\"\n ) {\n this.clientSuppliedCallbacks[methodName] =\n window.rudderanalytics[\n this.methodToCallbackMapping[methodName]\n ];\n }\n }\n // let callback =\n // ? typeof window.rudderanalytics[\n // this.methodToCallbackMapping[methodName]\n // ] == \"function\"\n // ? window.rudderanalytics[this.methodToCallbackMapping[methodName]]\n // : () => {}\n // : () => {};\n\n // logger.debug(\"registerCallbacks\", methodName, callback);\n\n // this.on(methodName, callback);\n }\n });\n }\n\n Object.keys(this.clientSuppliedCallbacks).forEach((methodName) => {\n if (this.clientSuppliedCallbacks.hasOwnProperty(methodName)) {\n logger.debug(\n \"registerCallbacks\",\n methodName,\n this.clientSuppliedCallbacks[methodName]\n );\n this.on(methodName, this.clientSuppliedCallbacks[methodName]);\n }\n });\n }\n\n sendSampleRequest() {\n ScriptLoader(\n \"ad-block\",\n \"//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js\"\n );\n }\n\n /**\n * parse the given query string into usable Rudder object\n * @param {*} query\n */\n parseQueryString(query) {\n function getTraitsFromQueryObject(qObj) {\n const traits = {};\n Object.keys(qObj).forEach((key) => {\n if (key.substr(0, queryDefaults.trait.length) == queryDefaults.trait) {\n traits[key.substr(queryDefaults.trait.length)] = qObj[key];\n }\n });\n\n return traits;\n }\n\n function getEventPropertiesFromQueryObject(qObj) {\n const props = {};\n Object.keys(qObj).forEach((key) => {\n if (key.substr(0, queryDefaults.prop.length) == queryDefaults.prop) {\n props[key.substr(queryDefaults.prop.length)] = qObj[key];\n }\n });\n\n return props;\n }\n\n const returnObj = {};\n const queryObject = querystring.parse(query);\n const userTraits = getTraitsFromQueryObject(queryObject);\n const eventProps = getEventPropertiesFromQueryObject(queryObject);\n if (queryObject.ajs_uid) {\n returnObj.userId = queryObject.ajs_uid;\n returnObj.traits = userTraits;\n }\n if (queryObject.ajs_aid) {\n returnObj.anonymousId = queryObject.ajs_aid;\n }\n if (queryObject.ajs_event) {\n returnObj.event = queryObject.ajs_event;\n returnObj.properties = eventProps;\n }\n\n return returnObj;\n }\n}\n\nfunction pushDataToAnalyticsArray(argumentsArray, obj) {\n if (obj.anonymousId) {\n if (obj.userId) {\n argumentsArray.unshift(\n [\"setAnonymousId\", obj.anonymousId],\n [\"identify\", obj.userId, obj.traits]\n );\n } else {\n argumentsArray.unshift([\"setAnonymousId\", obj.anonymousId]);\n }\n } else if (obj.userId) {\n argumentsArray.unshift([\"identify\", obj.userId, obj.traits]);\n }\n\n if (obj.event) {\n argumentsArray.push([\"track\", obj.event, obj.properties]);\n }\n}\n\nconst instance = new Analytics();\n\nEmitter(instance);\n\nwindow.addEventListener(\n \"error\",\n (e) => {\n handleError(e, instance);\n },\n true\n);\n\n// if (process.browser) {\n// test for adblocker\n// instance.sendSampleRequest()\n\n// initialize supported callbacks\ninstance.initializeCallbacks();\n\n// register supported callbacks\ninstance.registerCallbacks(false);\nconst eventsPushedAlready =\n !!window.rudderanalytics &&\n window.rudderanalytics.push == Array.prototype.push;\n\nconst argumentsArray = window.rudderanalytics;\n\nwhile (argumentsArray && argumentsArray[0] && argumentsArray[0][0] !== \"load\") {\n argumentsArray.shift();\n}\nif (\n argumentsArray &&\n argumentsArray.length > 0 &&\n argumentsArray[0][0] === \"load\"\n) {\n const method = argumentsArray[0][0];\n argumentsArray[0].shift();\n logger.debug(\"=====from init, calling method:: \", method);\n instance[method](...argumentsArray[0]);\n argumentsArray.shift();\n}\n\n// once loaded, parse querystring of the page url to send events\nconst parsedQueryObject = instance.parseQueryString(window.location.search);\n\npushDataToAnalyticsArray(argumentsArray, parsedQueryObject);\n\nif (eventsPushedAlready && argumentsArray && argumentsArray.length > 0) {\n for (let i = 0; i < argumentsArray.length; i++) {\n instance.toBeProcessedArray.push(argumentsArray[i]);\n }\n\n for (let i = 0; i < instance.toBeProcessedArray.length; i++) {\n const event = [...instance.toBeProcessedArray[i]];\n const method = event[0];\n event.shift();\n logger.debug(\"=====from init, calling method:: \", method);\n instance[method](...event);\n }\n instance.toBeProcessedArray = [];\n}\n// }\n\nconst ready = instance.ready.bind(instance);\nconst identify = instance.identify.bind(instance);\nconst page = instance.page.bind(instance);\nconst track = instance.track.bind(instance);\nconst alias = instance.alias.bind(instance);\nconst group = instance.group.bind(instance);\nconst reset = instance.reset.bind(instance);\nconst load = instance.load.bind(instance);\nconst initialized = (instance.initialized = true);\nconst getAnonymousId = instance.getAnonymousId.bind(instance);\nconst setAnonymousId = instance.setAnonymousId.bind(instance);\n\nexport {\n initialized,\n ready,\n page,\n track,\n load,\n identify,\n reset,\n alias,\n group,\n getAnonymousId,\n setAnonymousId,\n};\n"],"names":["Emitter","obj","key","prototype","mixin","module","on","addEventListener","event","fn","_callbacks","this","push","once","off","apply","arguments","removeListener","removeAllListeners","removeEventListener","length","cb","callbacks","i","splice","emit","args","Array","len","slice","listeners","hasListeners","count","callback","err_cb","bail","noop","proxy","err","result","Error","exports","str","replace","pattern","Object","toString","decode","decodeURIComponent","e","trim","charAt","pairs","split","m","parts","exec","LARGE_ARRAY_SIZE","HASH_UNDEFINED","HOT_COUNT","HOT_SPAN","MAX_SAFE_INTEGER","argsTag","asyncTag","funcTag","genTag","nullTag","objectTag","proxyTag","undefinedTag","reIsHostCtor","reIsUint","typedArrayTags","freeGlobal","_typeof","global","freeSelf","self","root","Function","freeExports","nodeType","freeModule","moduleExports","freeProcess","process","nodeUtil","types","require","binding","nodeIsTypedArray","isTypedArray","func","thisArg","call","uid","transform","arrayProto","funcProto","objectProto","coreJsData","funcToString","hasOwnProperty","maskSrcKey","keys","IE_PROTO","nativeObjectToString","objectCtorString","reIsNative","RegExp","Buffer","undefined","Symbol","Uint8Array","allocUnsafe","getPrototype","getPrototypeOf","arg","objectCreate","create","propertyIsEnumerable","symToStringTag","toStringTag","defineProperty","getNative","nativeIsBuffer","isBuffer","nativeMax","Math","max","nativeNow","Date","now","Map","nativeCreate","baseCreate","object","proto","isObject","Hash","entries","index","clear","entry","set","ListCache","MapCache","Stack","data","__data__","size","arrayLikeKeys","value","inherited","isArr","isArray","isArg","isArguments","isBuff","isType","skipIndexes","n","iteratee","baseTimes","String","isIndex","assignMergeValue","eq","baseAssignValue","assignValue","objValue","assocIndexOf","array","has","get","pop","getMapData","fromRight","baseFor","keysFunc","iterable","props","baseGetTag","isOwn","tag","unmasked","getRawTag","objectToString","baseIsArguments","isObjectLike","baseIsNative","isMasked","isFunction","test","toSource","baseKeysIn","nativeKeysIn","isProto","isPrototype","baseMerge","source","srcIndex","customizer","stack","srcValue","mergeFunc","safeGet","stacked","newValue","isCommon","isTyped","isArrayLike","copyArray","buffer","isDeep","constructor","copy","cloneBuffer","typedArray","arrayBuffer","byteLength","byteOffset","Ctor","isPlainObject","isNew","copyObject","keysIn","toPlainObject","initCloneObject","baseMergeDeep","baseRest","start","setToString","otherArgs","overRest","identity","map","type","isKeyable","getValue","lastCalled","stamp","remaining","shortOut","string","other","isLength","baseUnary","assigner","merge","sources","guard","isIterateeCall","hop","strCharAt","toStr","context","prop","indexKeys","target","pred","results","val","objectKeys","objToString","isNumber","arrayEach","iterator","baseEach","ks","collection","accumulator","TypeError","each","parse","require$$0","utm","query","param","substring","params","substr","allowedKeys","name","term","medium","content","foldl","acc","port","protocol","location","url","a","document","createElement","href","host","hash","hostname","pathname","search","indexOf","isAbsolute","window","LOG_LEVEL","logger","setLogLevel","logLevel","toUpperCase","info","console","log","debug","warn","error","commonNames","All","GoogleAnalytics","GA","GoogleAds","GOOGLEADS","Braze","BRAZE","Chartbeat","CHARTBEAT","Comscore","COMSCORE","Customerio","FB_PIXEL","GTM","Hotjar","hotjar","HOTJAR","Hubspot","HUBSPOT","Intercom","INTERCOM","Keen","KEEN","Kissmetrics","KISSMETRICS","Lotame","LOTAME","VWO","OPTIMIZELY","Optimizely","FULLSTORY","Fullstory","BUGSNAG","TVSQUARED","GoogleAnalytics4","GA4","MOENGAGE","AM","AMPLITUDE","Amplitude","Pendo","PENDO","Lytics","LYTICS","Appcues","APPCUES","clientToServerNames","CUSTOMERIO","FACEBOOK_PIXEL","HS","TVSQUUARED","MessageType","TRACK","PAGE","IDENTIFY","ECommerceEvents","PRODUCTS_SEARCHED","PRODUCT_LIST_VIEWED","PRODUCT_LIST_FILTERED","PROMOTION_VIEWED","PROMOTION_CLICKED","PRODUCT_CLICKED","PRODUCT_VIEWED","PRODUCT_ADDED","PRODUCT_REMOVED","CART_VIEWED","CHECKOUT_STARTED","CHECKOUT_STEP_VIEWED","CHECKOUT_STEP_COMPLETED","PAYMENT_INFO_ENTERED","ORDER_UPDATED","ORDER_COMPLETED","ORDER_REFUNDED","ORDER_CANCELLED","COUPON_ENTERED","COUPON_APPLIED","COUPON_DENIED","COUPON_REMOVED","PRODUCT_ADDED_TO_WISHLIST","PRODUCT_REMOVED_FROM_WISHLIST","WISH_LIST_PRODUCT_ADDED_TO_CART","PRODUCT_SHARED","CART_SHARED","PRODUCT_REVIEWED","CONFIG_URL","replacer","generateUUID","d","getTime","performance","c","r","random","floor","getCurrentTimeFormatted","toISOString","handleError","analyticsInstance","sampleAdBlockTest","errorMessage","message","Event","localName","src","id","includes","page","path","title","sendAdblockPageOptions","getDefaultPageProperties","canonicalUrl","getCanonicalUrl","referrer","hashIndex","getUrl","tags","getElementsByTagName","getAttribute","getRevenue","properties","eventName","revenue","match","total","parseFloat","isNaN","getCurrency","tranformToRudderNames","integrationObject","forEach","findAllEnabledDestinations","sdkSuppliedIntegrations","configPlaneEnabledIntegrations","enabledList","allValue","intg","intgValue","rejectArr","compact","rejectarray","rejectobject","arr","ret","k","flattenJsonPayload","recurse","cur","res","l","isEmpty","symbolValueOf","bigIntValueOf","ScriptLoader","js","async","parentNode","insertBefore","config","hubId","hubID","hubspotJs","rudderElement","traits","traitsValue","getOwnPropertyDescriptor","hubspotkey","userProperties","user_properties","_hsq","eventValue","objProto","owns","valueOf","BigInt","isActualNaN","NON_HOST_TYPES","number","base64Regex","hexRegex","is","defined","empty","equal","hosted","instance","nil","undef","isStandardArguments","isOldArguments","arraylike","callee","bool","isFinite","Boolean","Number","date","valid","element","HTMLElement","alert","infinite","Infinity","decimal","divisibleBy","isDividendInfinite","isDivisorInfinite","isNonZeroNumber","integer","maximum","others","minimum","nan","even","odd","ge","gt","le","lt","within","finish","primitive","setInterval","regexp","base64","hex","symbol","bigint","expr","globals","p","unique","_","prefixed","require$$1","toFunction","defaultToFunction","objectToFunction","stripNested","re","$0","$1","ctx","trackingID","sendUserId","dimensions","metrics","contentGroupings","nonInteraction","anonymizeIp","useGoogleAmpClientId","domain","doubleClick","enhancedEcommerce","enhancedLinkAttribution","includeSearch","setAllMappedProps","siteSpeedSampleRate","sampleRate","trackCategorizedPages","trackNamedPages","optimizeContainerId","optimize","resetCustomDimensionsOnPage","enhancedEcommerceLoaded","namedTracker","eventWithCategoryFieldProductScoped","elementTo","pageCalled","dimensionsArray","to","startsWith","_this","from","metricsArray","contentGroupingsArray","GoogleAnalyticsObject","ga","q","loadScript","cookieDomain","defaults","allowLinker","useAmpClientId","trackerName","ecommerce","userId","custom","metricsFunction","payload","filters","sorts","options","extractCheckoutOptions","products","eventCategory","category","orderId","order_id","eventAction","eventLabel","label","campaign","loadEnhancedEcommerce","product","productTrack","createProductTrack","enhancedEcommerceTrackProduct","step","option","pushEnhancedEcommerce","affiliation","tax","shipping","coupon","track","_this2","product_id","sku","quantity","enhancedEcommerceTrackProductAction","list","promotion_id","creative","position","item","impressionObj","list_id","brand","band","variant","price","getProductPosition","join","sorters","formatValue","campaignName","campaignSource","campaignMedium","campaignContent","campaignKeyword","setCustomDimenionsAndMetrics","currency","eventProperties","pageTitle","pageview","pagePath","pageReferrer","resetCustomDimensions","property","gaplugins","group","round","action","toLowerCase","x","paymentMethod","shippingMethod","siteId","siteID","_ready","hotjarSiteId","h","o","t","j","hj","_hjSettings","hjid","hjsv","appendChild","anonymousId","conversionId","conversionID","pageLoadConversions","clickEventConversions","defaultPageConversion","dataLayer","gtag","conversionData","getConversionData","conversionLabel","sendToValue","transaction_id","send_to","eventTypeConversions","eventTypeConversion","analytics","accountId","settingsTolerance","isSPA","libraryTolerance","useExistingJquery","sendExperimentTrack","sendExperimentIdentify","account_id","settings_tolerance","library_tolerance","use_existing_jquery","_vwo_code","f","getElementById","removeChild","finished","load","b","innerText","onerror","init","settings_timer","setTimeout","setAttribute","styleSheet","cssText","createTextNode","encodeURIComponent","URL","_vwo_settings_timer","experimentViewedIdentify","experimentViewed","expId","variationId","_vwo_exp","comb_n","experimentId","variationName","identify","GoogleTagManager","containerID","w","s","rudderMessage","sendToGTMDatalayer","pageName","pageCategory","appKey","endPoint","dataCenter","dataCenterArr","gender","appboy","ab","User","Genders","FEMALE","MALE","OTHER","P","y","appboyQueue","getUser","getCachedFeed","Feed","getCachedContentCards","ContentCards","initialize","enableLogging","baseUrl","display","automaticallyShowNewInAppMessages","changeUser","openSession","address","avatar","birthday","email","firstname","lastname","phone","JSON","stringify","setAvatarImageUrl","setEmail","setFirstName","setGender","formatGender","setLastName","setPhoneNumber","setCountry","country","setHomeCity","city","setDateOfBirth","getUTCFullYear","getUTCMonth","getUTCDate","setCustomUserAttribute","currencyCode","del","productId","logPurchase","handlePurchase","handleReservedProperties","logCustomEvent","base64map","crypt","rotl","rotr","endian","randomBytes","bytes","bytesToWords","words","wordsToBytes","bytesToHex","hexToBytes","parseInt","bytesToBase64","triplet","base64ToBytes","imod4","pow","charenc","utf8","stringToBytes","bin","unescape","bytesToString","escape","charCodeAt","fromCharCode","readFloatLE","isSlowBuffer","_isBuffer","require$$2","md5","encoding","FF","_ff","GG","_gg","HH","_hh","II","_ii","aa","bb","cc","dd","_blocksize","_digestsize","digestbytes","asBytes","asString","NAME","API_KEY","apiKey","APP_ID","appId","MOBILE_APP_ID","mobileAppId","intercomSettings","app_id","ic","readyState","intercom_code","attachEvent","rawPayload","userHash","user_hash","hideDefaultLauncher","hide_default_launcher","field","companies","company","company_id","companyFields","created_at","user_id","event_name","originalTimestamp","projectID","writeKey","ipAddon","uaAddon","urlAddon","referrerAddon","client","check","KeenTracking","projectId","initKeen","clearInterval","bind","assign","user","getAddOn","extendEvents","recordEvent","addOns","ip_address","input","ip","output","user_agent","ua_string","page_url","referrer_url","keen","addons","dest","multiple","normalize","normalizer","defaultNormalize","loop","normalizedKey","temp","child","prefixProperties","_kmq","_kmk","_kms","u","isEnvMobile","navigator","userAgent","toUnixTimestamp","nestedObj","flattenedObj","flatten","safe","extend","opts","delimiter","maxDepth","currentDepth","prev","isarray","isobject","newKey","clean","timestamp","prefix","_t","_d","KM","previousId","groupId","groupTraits","CustomerIO","_cio","concat","body","interval","_sf_async_config","useCanonical","isVideo","video","sendNameAndCategoryAsTitle","subscriberEngagementKeys","replayEvents","failed","isFirstPageCallMade","loadConfig","isLoaded","pSUPERFLY","virtualPage","initAfterPage","author","sections","authors","_cbq","script","_isReady","then","time","Promise","resolve","pause","c2ID","comScoreBeaconParam","comScoreParams","beacon","mapComscoreParams","_comscore","el","comScoreBeaconParamsMap","c1","c2","FacebookPixel","blacklistPiiProperties","categoryToContent","pixelId","eventsToEvents","eventCustomProperties","valueFieldIdentifier","advancedMapping","traitKeyToExternalId","legacyConversionPixelId","userIdAsPixelId","whitelistPiiProperties","_fbq","fbq","callMethod","queue","loaded","disablePushState","allowDuplicatePageViews","version","formatRevenue","buildPayLoad","standardTo","legacyTo","standard","legacy","reduce","filtered","eventID","messageId","contents","customProperties","contentIds","contentType","content_ids","content_type","getContentType","useValue","content_name","product_name","content_category","item_price","pId","num_items","search_string","contentCategory","defaultValue","mappedTo","mapped","obj1","obj2","propObj1","propObj2","toFixed","isStandardEvent","dateFields","defaultPiiProperties","customPiiProperties","configuration","blacklistPiiHash","toISOTring","sha256","isPropertyPii","isProperyWhiteListed","CryptoJS","F","subtype","C","C_lib","lib","Base","overrides","mixIn","$super","propertyName","clone","WordArray","sigBytes","encoder","Hex","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","clamp","thatByte","ceil","nBytes","rcache","m_w","m_z","mask","_r","C_enc","enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","latin1Str","latin1StrLength","Utf8","utf8Str","BufferedBlockAlgorithm","reset","_data","_nDataBytes","_append","_process","doFlush","dataWords","dataSigBytes","blockSize","nBlocksReady","nWordsReady","_minBufferSize","nBytesReady","min","offset","_doProcessBlock","processedWords","C_algo","Hasher","cfg","_doReset","update","messageUpdate","finalize","_doFinalize","_createHelper","hasher","_createHmacHelper","HMAC","algo","Base64","_map","base64Chars","paddingChar","base64Str","base64StrLength","reverseMap","_reverseMap","paddingIndex","bits1","bits2","parseLoop","T","abs","sin","MD5","_hash","M","offset_i","M_offset_i","H","M_offset_0","M_offset_1","M_offset_2","M_offset_3","M_offset_4","M_offset_5","M_offset_6","M_offset_7","M_offset_8","M_offset_9","M_offset_10","M_offset_11","M_offset_12","M_offset_13","M_offset_14","M_offset_15","nBitsTotal","nBitsLeft","nBitsTotalH","nBitsTotalL","H_i","HmacMD5","W","SHA1","HmacSHA1","_hasher","hasherBlockSize","hasherBlockSizeBytes","oKey","_oKey","iKey","_iKey","oKeyWords","iKeyWords","innerHash","EvpKDF","keySize","iterations","compute","password","salt","derivedKey","derivedKeyWords","block","Cipher","C_mode","BlockCipherMode","CBC","Pkcs7","CipherParams","OpenSSLFormatter","SerializableCipher","OpenSSLKdf","PasswordBasedCipher","createEncryptor","_ENC_XFORM_MODE","createDecryptor","_DEC_XFORM_MODE","xformMode","_xformMode","_key","dataUpdate","ivSize","selectCipherStrategy","cipher","encrypt","decrypt","ciphertext","StreamCipher","mode","iv","Encryptor","Decryptor","_cipher","_iv","xorBlock","_prevBlock","processBlock","encryptBlock","thisBlock","decryptBlock","pad","blockSizeBytes","nPaddingBytes","paddingWord","paddingWords","padding","unpad","BlockCipher","modeCreator","_mode","__creator","finalProcessedBlocks","cipherParams","formatter","format","OpenSSL","openSSLStr","ciphertextWords","encryptor","cipherCfg","algorithm","_parse","kdf","execute","derivedParams","SBOX","INV_SBOX","SUB_MIX_0","SUB_MIX_1","SUB_MIX_2","SUB_MIX_3","INV_SUB_MIX_0","INV_SUB_MIX_1","INV_SUB_MIX_2","INV_SUB_MIX_3","xi","sx","x2","x4","x8","RCON","AES","_nRounds","_keyPriorReset","keyWords","ksRows","keySchedule","_keySchedule","ksRow","invKeySchedule","_invKeySchedule","invKsRow","_doCryptBlock","nRounds","s0","s1","s2","s3","t0","t1","t2","t3","flags","multiline","ignoreCase","ms","plural","long","short","namespace","disabled","enabled","curr","prevTime","diff","useColors","color","colors","prevColor","coerce","formatters","formatArgs","enable","namespaces","save","skips","names","storage","humanize","lastC","removeItem","documentElement","style","firebug","exception","table","chrome","local","localStorage","localstorage","v","all","encode","maxage","expires","toUTCString","samesite","secure","cookie","pair","toDrop","resultsLength","shallowCombiner","deepCombiner","defaultsDeep","defaultsWith","combiner","drop","rest","objectTypes","runInContext","SyntaxError","nativeJSON","getClass","isProperty","attempt","errorFunc","isExtended","isSupported","serialized","stringifySupported","toJSON","parseSupported","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","charIndexBuggy","forOwn","Properties","dontEnums","isConstructor","hasProperty","Escapes","toPaddedString","width","serializeDate","getData","year","month","hours","minutes","seconds","milliseconds","Months","getDay","dateToJSON","nativeStringify","filter","nativeToJSON","escapeChar","character","charCode","escaped","reEscape","quote","lastIndex","whitespace","className","serialize","indentation","Index","Source","Unescapes","abort","lex","begin","isSigned","walk","hasMembers","previousJSON","JSON3","isRestored","levels","last","Cookie","_options","topDomain","remove","store","win","doc","localStorageName","defaultVal","transact","transactionFn","getAll","deserialize","isLocalStorageNameSupported","setItem","getItem","addBehavior","storageOwner","storageContainer","ActiveXObject","open","write","close","frames","withIEStorage","storeFunction","unshift","forbiddenCharsRegex","ieKeyFix","removeAttribute","attributes","XMLDocument","attr","testKey","Store","encryptValue","decryptValue","lotameStorage","Storage","LotameStorage","bcpUrlSettingsPixel","bcpUrlSettingsIframe","dspUrlSettingsPixel","dspUrlSettingsIframe","mappings","mapping","LOTAME_SYNCH_CALLBACK","height","image","iframe","currentTime","urlSettings","dspUrl","compileUrl","dspUrlTemplate","addPixel","addIFrame","setLotameSynchTime","methodToCallbackMapping","syncPixel","destination","replaceKey","regex","bcpUrl","_this3","bcpUrlTemplate","isPixelToBeSynched","lastSynchedTime","getLotameSynchTime","referrerOverride","optimizelyEffectiveReferrer","sendDataToRudder","campaignState","experiment","variation","integrations","audiences","audiencesMap","audience","audienceIds","sort","audienceNames","values","campaignId","experimentName","audienceId","audienceName","isInCampaignHoldback","sendExperimentTrackAsNonInteractive","customCampaignProperties","rudderProp","optimizelyProp","revenueOnlyOnOrderCompleted","customExperimentProperties","initOptimizelyIntegration","sendCampaignData","newActiveCampaign","state","optimizely","getCampaignStates","isActive","checkReferrer","getRedirectInfo","activeCampaigns","handler","registerCurrentlyActiveCampaigns","Bugsnag","releaseStage","setIntervalHandler","initBugsnagClient","bugsnag","bugsnagClient","traitsFinal","notify","camelCase","pascalCase","toLocaleUpperCase","toLocaleLowerCase","isLastCharLower","isLastCharUpper","isLastLastCharUpper","preserveCamelCase","p1","fs_org","fs_debug_mode","_fs_debug","_fs_host","_fs_script","_fs_org","_fs_namespace","g","_api","crossOrigin","setUserVars","shutdown","restart","consent","identifyAccount","acctId","clearUserCookie","_w","FS","getFSProperties","FS_properties","camelCaseField","fieldName","typeSuffix","camelcase","TVSquared","_tvq","isReady","rev","brandId","clientId","eventWhiteList","customMetrics","productType","whitelist","wl","session","prod","promo","cm","setCustomVariable","requiredEventParameters","includeParams","CartShare","share_via","cart_id","ProductShare","Search","Promotion","eventParametersConfigArray","ListId","inItems","Category","Price","Currency","Coupon","Affiliation","Shipping","Tax","Total","CheckoutId","ShippingMethod","PaymentMethod","itemParametersConfigArray","eventNamesConfigArray","requiredParams","onlyIncludeParams","hasItem","includeList","pageEventParametersConfigArray","getDestinationEventProperties","destParameterConfig","destinationProperties","items","createItemProperty","getPageViewProperty","measurementId","blockPageView","blockPageViewEvent","extendPageViewParams","send_page_view","getDestinationItemProperties","parameters","checkRequiredParameters","eventMappingObj","hasRequiredParameters","getIncludedParameters","getdestinationProperties","sendGAEvent","eventMappingArray","getDestinationEventName","events","handleEventMapper","userTraits","pageProps","traitsMap","firstName","lastName","username","userName","MoEngage","analyticsinstance","moeBannerText","apiId","region","moengage_object","moengage_q","onsite","moe","onload","moeClient","debug_logs","cluster","initialUserId","track_event","destroy_session","add_unique_user_id","add_user_name","method","add_user_attribute","trackAllPages","trackUtmProperties","trackReferrer","batchEvents","eventUploadThreshold","eventUploadPeriodMillis","forceHttps","trackGclid","saveParamsReferrerOncePerSession","deviceIdFromUrlParam","trackRevenuePerProduct","preferAnonymousIdForDeviceId","traitsToSetOnce","traitsToIncrement","appendFieldsToEventProps","unsetParamsReferrerOnNewSession","trackProductsOnce","versionName","amplitude","_q","_iq","integrity","runQueuedFunctions","Identify","Revenue","getInstance","initOptions","includeUtm","includeGclid","includeReferrer","deviceId","getAnonymousId","setVersionName","setDeviceId","setUserId","amplitudeIdentify","trait","shouldIncrement","shouldSetOnce","add","setOnce","clonedTrackEvent","allProducts","productKeys","getProductAttributes","logEventAndCorrespondingRevenue","trackEventMessage","trackingEventAndRevenuePerProduct","shouldTrackEventPerProduct","revenueType","revenue_type","trackRevenue","dontTrackRevenue","logEvent","groupTypeTrait","groupValueTrait","groupType","groupValue","setGroup","amplitudeRevenue","setPrice","setQuantity","setEventProperties","setRevenueType","setProductId","logRevenueV2","HubSpot","FBPixel","z","initializeMe","constructPendoAnonymousId","accountObj","visitorObj","pendo","account","visitor","stream","blockload","loadid","jstag","head","lastChild","blocked","sessecs","protocal","loadLyticsScript","send","pageView","_e","RudderApp","build","RudderLibraryInfo","RudderOSInfo","RudderScreenInfo","density","RudderContext","app","library","os","screen","devicePixelRatio","locale","language","browserLanguage","device","network","RudderMessage","channel","messageType","checkForKey","SCREEN","RudderElement","rudderProperty","rudderUserProperty","RudderElementBuilder","inputRudderProperty","rudderPropertyBuilder","inputRudderUserProperty","rudderUserPropertyBuilder","eventType","setType","setEventName","setProperty","setUserProperty","getRandomValues","crypto","msCrypto","rnds8","rnds","byteToHex","_nodeId","_clockseq","buf","bth","_lastMSecs","_lastNSecs","node","clockseq","seedBytes","rng","msecs","nsecs","dt","tl","tmh","bytesToUuid","ii","uuid","v4","v1","inMemoryStore","isSupportedNatively","defaultEngine","inMemoryEngine","optionalEngine","engine","compoundKey","_createValidKey","json","quotaExceeded","code","isQuotaExceeded","_swapEngine","defaultClock","clearTimeout","clock","Schedule","tasks","nextId","run","task","timeout","_handle","cancel","cancelAll","setClock","newClock","resetClock","fmt","disable","Queue","maxItems","maxAttempts","backoff","MIN_RETRY_DELAY","minRetryDelay","MAX_RETRY_DELAY","maxRetryDelay","FACTOR","backoffFactor","JITTER","backoffJitter","timeouts","ACK_TIMER","RECLAIM_TIMER","RECLAIM_TIMEOUT","RECLAIM_WAIT","IN_PROGRESS","QUEUE","ACK","RECLAIM_START","RECLAIM_END","_schedule","_processId","_store","_ack","_checkReclaim","_processHead","_running","stop","shouldRetry","attemptNumber","getDelay","rand","deviation","toPrecision","addItem","_enqueue","requeue","inProgress","toRun","enqueue","done","inProgressSize","shift","_reclaim","tryReclaim","findOtherQueues","our","their","RudderPayload","batch","queueOptions","eventRepository","eventsBuffer","batchSize","payloadQueue","sentAt","processQueueElement","headers","repo","eventsPayload","xhr","XMLHttpRequest","setRequestHeader","btoa","onreadystatechange","status","queueFn","ontimeout","statusText","getElementContent","Authorization","AnonymousId","addDomEventHandlers","rudderanalytics","queryDefaults","EventRepository","autoTrackHandlersRegistered","autoTrackFeatureEnabled","initialized","trackValues","clientIntegrations","loadOnlyIntegrations","clientIntegrationObjects","successfullyLoadedIntegration","failedToBeLoadedIntegration","toBeProcessedArray","toBeProcessedByIntegrationArray","sendAdblockPage","clientSuppliedCallbacks","readyCallback","executeReadyCallback","getUserId","getUserTraits","getGroupId","getGroupTraits","setAnonymousId","setGroupId","setUserTraits","setGroupTraits","response","useAutoTracking","destinations","destinationDefinition","useNativeSDK","intgArray","intgInstance","intgClass","isInitialized","after","methodName","succesfulLoadedIntersectClientSuppliedIntegrations","isFailed","sendSampleRequest","processPage","processTrack","processIdentify","processAndSendDataToDestinations","getPageProperties","trackPage","trackEvent","identifyUser","processOptionsParam","addCampaignInfo","getContextPageProperties","toplevelElements","defaultPageProperties","optionPageProperties","contextPageProperties","serverUrl","configUrl","isValidWriteKey","isValidServerUrl","getUserProvidedConfigUrl","tranformedCallbackMapping","registerCallbacks","startQueue","initializeUser","valTrackingList","cb_","responseText","getJSONTrimmed","processResponse","_this4","calledFromLoad","_this5","qObj","returnObj","queryObject","querystring","eventProps","getEventPropertiesFromQueryObject","ajs_uid","ajs_aid","ajs_event","initializeCallbacks","eventsPushedAlready","argumentsArray","pushDataToAnalyticsArray","parseQueryString","ready","alias"],"mappings":"2zDAeSA,EAAQC,MACXA,EAAK,gBAWIA,OACR,IAAIC,KAAOF,EAAQG,UACtBF,EAAIC,GAAOF,EAAQG,UAAUD,UAExBD,EAfSG,CAAMH,GAVtBI,UAAiBL,EAqCnBA,EAAQG,UAAUG,GAClBN,EAAQG,UAAUI,iBAAmB,SAASC,EAAOC,eAC9CC,WAAaC,KAAKD,YAAc,IACpCC,KAAKD,WAAW,IAAMF,GAASG,KAAKD,WAAW,IAAMF,IAAU,IAC7DI,KAAKH,GACDE,MAaTX,EAAQG,UAAUU,KAAO,SAASL,EAAOC,YAC9BH,SACFQ,IAAIN,EAAOF,GAChBG,EAAGM,MAAMJ,KAAMK,kBAGjBV,EAAGG,GAAKA,OACHH,GAAGE,EAAOF,GACRK,MAaTX,EAAQG,UAAUW,IAClBd,EAAQG,UAAUc,eAClBjB,EAAQG,UAAUe,mBAClBlB,EAAQG,UAAUgB,oBAAsB,SAASX,EAAOC,WACjDC,WAAaC,KAAKD,YAAc,GAGjC,GAAKM,UAAUI,mBACZV,WAAa,GACXC,SAcLU,EAVAC,EAAYX,KAAKD,WAAW,IAAMF,OACjCc,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k-js/README.md +++ b/dist/rudder-sdk-js/README.md @@ -12,68 +12,9 @@ This Quick Start Guide will help you get up and running with using the RudderSta ## [](https://github.com/rudderlabs/rudder-sdk-js/blob/master/README.md#step-1-install-rudderstack-using-the-code-snippet)Step 1: Install RudderStack using the code snippet -To integrate the SDK, place the following code snippet in the `` section of your website. +To integrate the SDK: -You can use either the minified or non-minified version of the code: - -The minified version is as follows: - -``` - - - - -``` - -The non-minified version of the code is shown below: - -``` - - - - -``` - -**NOTE**: Whichever version of the code you use, you need to replace `YOUR_WRITE_KEY` with the write key in the RudderStack Control Plane and `DATA_PLANE_URI` with the URI of the RudderStack Server/ Data Plane. - -You can also execute the min file in async/defer way, like: - -``` - - -``` - -**NOTE**: We are moving our sdk to a diiferent path from the earlier [https://cdn.rudderlabs.com/rudder-analytics.min.js](https://cdn.rudderlabs.com/rudder-analytics.min.js) to [https://cdn.rudderlabs.com/v1/rudder-analytics.min.js](https://cdn.rudderlabs.com/v1/rudder-analytics.min.js). The earlier path may not be maintained in coming releases. - -**Alternative installation using NPM** +**Installation using NPM** It is recommended to use the snippet above to use Rudder SDK in your websites, but one can use this [NPM module](https://www.npmjs.com/package/rudder-js) to package Rudder directly into your project. - To install: @@ -91,6 +32,17 @@ var rudderanalytics = require("rudder-sdk-js") rudderanalytics.load("YOUR_WRITE_KEY", "DATA_PLANE_URI") exports.rudderanalytics = rudderanalytics ``` + +For destinations where you don't want the SDK to load the third-party scripts separately, modify the load call: +``` +rudderanalytics.load("YOUR_WRITE_KEY", "DATA_PLANE_URI", {loadIntegration: false}) +// the SDK expects that the destination global queue or function for pushing events is +// already present for the destinations. +// Currently, the loadIntegration flag is supported for Amplitude and +// Google Analytics destinations. The SDK expects window.amplitude and window.ga to be already +// defined by the user separately for sending events to these destinations. + +``` You can also refer to the sample projects for a walkthrough of the above: [sample angular project](https://github.com/rudderlabs/rudder-analytics-angular) and [sample react project](https://github.com/rudderlabs/rudder-analytics-react) diff --git a/dist/rudder-sdk-js/index.html b/dist/rudder-sdk-js/index.html new file mode 100644 index 000000000..97f7b4ef9 --- /dev/null +++ b/dist/rudder-sdk-js/index.html @@ -0,0 +1,8 @@ + + + + + +

HI..

+ + diff --git a/dist/rudder-sdk-js/index.js b/dist/rudder-sdk-js/index.js index 462d481bd..8be0c7442 100644 --- a/dist/rudder-sdk-js/index.js +++ b/dist/rudder-sdk-js/index.js @@ -2,9 +2,11 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.rudderanalytics = {})); -}(this, function (exports) { 'use strict'; +}(this, (function (exports) { 'use strict'; function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; @@ -74,13 +76,13 @@ var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { - ownKeys(source, true).forEach(function (key) { + ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { - ownKeys(source).forEach(function (key) { + ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } @@ -90,23 +92,36 @@ } function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; - - return arr2; - } + if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { - if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; } function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance"); + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -115,6 +130,10 @@ return module = { exports: {} }, fn(module, module.exports), module.exports; } + function getCjsExportFromNamespace (n) { + return n && n['default'] || n; + } + var componentEmitter = createCommonjsModule(function (module) { /** * Expose `Emitter`. @@ -318,15 +337,24 @@ exports = module.exports = trim; function trim(str) { - return str.replace(/^\s*|\s*$/g, ''); + if (str.trim) return str.trim(); + return exports.right(exports.left(str)); } exports.left = function (str) { - return str.replace(/^\s*/, ''); + if (str.trimLeft) return str.trimLeft(); + return str.replace(/^\s\s*/, ''); }; exports.right = function (str) { - return str.replace(/\s*$/, ''); + if (str.trimRight) return str.trimRight(); + var whitespace_pattern = /\s/, + i = str.length; + + while (whitespace_pattern.test(str.charAt(--i))) { + } + + return str.slice(0, i + 1); }; }); var trim_2 = trim_1.left; @@ -3148,7 +3176,10 @@ Lytics: "Lytics", LYTICS: "Lytics", Appcues: "APPCUES", - APPCUES: "APPCUES" + APPCUES: "APPCUES", + POSTHOG: "POSTHOG", + PostHog: "POSTHOG", + Posthog: "POSTHOG" }; // from client native integration name to server identified display name @@ -3178,10 +3209,13 @@ AM: "Amplitude", PENDO: "Pendo", LYTICS: "Lytics", - APPCUES: "Appcues" + APPCUES: "Appcues", + POSTHOG: "PostHog" }; - // Message Type enumeration + // Reserved Keywords for properties/triats + var ReservedPropertyKeywords = ["anonymous_id", "id", "sent_at", "received_at", "timestamp", "original_timestamp", "event_text", "event"]; // Message Type enumeration + var MessageType = { TRACK: "track", PAGE: "page", @@ -3220,7 +3254,7 @@ PRODUCT_REVIEWED: "Product Reviewed" }; // Enumeration for integrations supported - var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.0.14"; + var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.0.15"; var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000; var INTEGRATION_LOAD_CHECK_INTERVAL = 1000; /* module.exports = { @@ -3621,6 +3655,44 @@ return url; } + /** + * Check if a reserved keyword is present in properties/traits + * @param {*} properties + * @param {*} reservedKeywords + * @param {*} type + */ + + + function checkReservedKeywords(message, messageType) { + // properties, traits, contextualTraits are either undefined or object + var properties = message.properties, + traits = message.traits; + var contextualTraits = message.context.traits; + + if (properties) { + Object.keys(properties).forEach(function (property) { + if (ReservedPropertyKeywords.indexOf(property.toLowerCase()) >= 0) { + logger.error("Warning! : Reserved keyword used in properties--> ".concat(property, " with ").concat(messageType, " call")); + } + }); + } + + if (traits) { + Object.keys(traits).forEach(function (trait) { + if (ReservedPropertyKeywords.indexOf(trait.toLowerCase()) >= 0) { + logger.error("Warning! : Reserved keyword used in traits--> ".concat(trait, " with ").concat(messageType, " call")); + } + }); + } + + if (contextualTraits) { + Object.keys(contextualTraits).forEach(function (contextTrait) { + if (ReservedPropertyKeywords.indexOf(contextTrait.toLowerCase()) >= 0) { + logger.error("Warning! : Reserved keyword used in traits --> ".concat(contextTrait, " with ").concat(messageType, " call")); + } + }); + } + } /* ------- Start FlattenJson ----------- * This function flatten given json object to single level. * So if there is nested object or array, all will apear in first level properties of an object. @@ -3668,13 +3740,12 @@ js.type = "text/javascript"; js.id = id; var e = document.getElementsByTagName("script")[0]; - logger.debug("==script==", e); + logger.debug("==parent script==", e); + logger.debug("==adding script==", js); e.parentNode.insertBefore(js, e); }; - var HubSpot = - /*#__PURE__*/ - function () { + var HubSpot = /*#__PURE__*/function () { function HubSpot(config) { _classCallCheck(this, HubSpot); @@ -4986,12 +5057,11 @@ } } - var GA = - /*#__PURE__*/ - function () { - function GA(config) { + var GA = /*#__PURE__*/function () { + function GA(config, analytics) { _classCallCheck(this, GA); + this.analytics = analytics; this.trackingID = config.trackingID; this.sendUserId = config.sendUserId || false; this.dimensions = config.dimensions || []; @@ -5019,6 +5089,18 @@ } _createClass(GA, [{ + key: "initializeGlobalObject", + value: function initializeGlobalObject() { + window.GoogleAnalyticsObject = "ga"; + + window.ga = window.ga || function a() { + window.ga.q = window.ga.q || []; + window.ga.q.push(arguments); + }; + + window.ga.l = new Date().getTime(); + } + }, { key: "loadScript", value: function loadScript() { ScriptLoader("google-analytics", "https://www.google-analytics.com/analytics.js"); @@ -5053,15 +5135,12 @@ this.contentGroupings.forEach(function (element) { _this.contentGroupingsArray[element.from] = element.to; }); - window.GoogleAnalyticsObject = "ga"; - window.ga = window.ga || function a() { - window.ga.q = window.ga.q || []; - window.ga.q.push(arguments); - }; + if (this.analytics.loadIntegration) { + this.initializeGlobalObject(); + this.loadScript(); + } // create ga with these properties. if the properties are empty it will take default values. - window.ga.l = new Date().getTime(); - this.loadScript(); // create ga with these properties. if the properties are empty it will take default values. var config = { cookieDomain: this.domain || GA.prototype.defaults.domain, @@ -5080,24 +5159,26 @@ window.ga("create", this.trackingID, config); - if (this.optimizeContainerId) { - window.ga("".concat(this.trackerName, "require"), this.optimizeContainerId); - } // ecommerce is required + if (this.analytics.loadIntegration) { + if (this.optimizeContainerId) { + window.ga("".concat(this.trackerName, "require"), this.optimizeContainerId); + } // ecommerce is required - if (!this.ecommerce) { - window.ga("".concat(this.trackerName, "require"), "ecommerce"); - this.ecommerce = true; - } // this is to display advertising + if (!this.ecommerce) { + window.ga("".concat(this.trackerName, "require"), "ecommerce"); + this.ecommerce = true; + } // this is to display advertising - if (this.doubleClick) { - window.ga("".concat(this.trackerName, "require"), "displayfeatures"); - } // https://support.google.com/analytics/answer/2558867?hl=en + if (this.doubleClick) { + window.ga("".concat(this.trackerName, "require"), "displayfeatures"); + } // https://support.google.com/analytics/answer/2558867?hl=en - if (this.enhancedLinkAttribution) { - window.ga("".concat(this.trackerName, "require"), "linkid"); + if (this.enhancedLinkAttribution) { + window.ga("".concat(this.trackerName, "require"), "linkid"); + } } // a warning is in ga debugger if anonymize is false after initialization @@ -5337,7 +5418,7 @@ price: item.properties.price, position: self.getProductPosition(item, products) }; - impressionObj = _objectSpread2({}, impressionObj, {}, self.metricsFunction(item.properties, self.dimensionsArray, self.metricsArray, self.contentGroupingsArray)); + impressionObj = _objectSpread2(_objectSpread2({}, impressionObj), self.metricsFunction(item.properties, self.dimensionsArray, self.metricsArray, self.contentGroupingsArray)); Object.keys(impressionObj).forEach(function (key) { if (impressionObj[key] === undefined) delete impressionObj[key]; }); @@ -5490,13 +5571,13 @@ window.ga("".concat(this.trackerName, "set"), resetCustomDimensions); // adds more properties to pageview which will be sent - pageview = _objectSpread2({}, pageview, {}, this.setCustomDimenionsAndMetrics(eventProperties)); + pageview = _objectSpread2(_objectSpread2({}, pageview), this.setCustomDimenionsAndMetrics(eventProperties)); var payload = { page: pagePath, title: pageTitle }; - logger.debug(pageReferrer); - logger.debug(document.referrer); + logger.debug("referrer: " + pageReferrer); + logger.debug("document referrer: ", document.referrer); if (pageReferrer !== document.referrer) payload.referrer = pageReferrer; window.ga("".concat(this.trackerName, "set"), payload); if (this.pageCalled) delete pageview.location; @@ -5670,7 +5751,7 @@ var coupon = props.coupon; if (coupon) product.coupon = coupon; - product = _objectSpread2({}, product, {}, this.metricsFunction(props, this.dimensionsArray, this.metricsArray, this.contentGroupingsArray)); + product = _objectSpread2(_objectSpread2({}, product), this.metricsFunction(props, this.dimensionsArray, this.metricsArray, this.contentGroupingsArray)); window.ga("".concat(this.trackerName, "ec:addProduct"), product); } /** @@ -5747,9 +5828,7 @@ var index$1 = GA ; - var Hotjar = - /*#__PURE__*/ - function () { + var Hotjar = /*#__PURE__*/function () { function Hotjar(config) { _classCallCheck(this, Hotjar); @@ -5823,9 +5902,7 @@ var index$2 = Hotjar ; - var GoogleAds = - /*#__PURE__*/ - function () { + var GoogleAds = /*#__PURE__*/function () { function GoogleAds(config) { _classCallCheck(this, GoogleAds); @@ -5945,9 +6022,7 @@ var index$3 = GoogleAds ; - var VWO = - /*#__PURE__*/ - function () { + var VWO = /*#__PURE__*/function () { function VWO(config, analytics) { _classCallCheck(this, VWO); @@ -6107,9 +6182,7 @@ return VWO; }(); - var GoogleTagManager = - /*#__PURE__*/ - function () { + var GoogleTagManager = /*#__PURE__*/function () { function GoogleTagManager(config) { _classCallCheck(this, GoogleTagManager); @@ -6208,9 +6281,7 @@ E-commerce support required for logPurchase support & other e-commerce events as track with productId changed */ - var Braze = - /*#__PURE__*/ - function () { + var Braze = /*#__PURE__*/function () { function Braze(config, analytics) { _classCallCheck(this, Braze); @@ -6562,7 +6633,7 @@ // Convert to byte array if (message.constructor == String) { if (options && options.encoding === 'binary') message = bin.stringToBytes(message);else message = utf8.stringToBytes(message); - } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message)) message = message.toString(); // else, assume byte array already + } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString(); // else, assume byte array already var m = crypt$1.bytesToWords(message), l = message.length * 8, @@ -6695,9 +6766,7 @@ })(); }); - var INTERCOM = - /*#__PURE__*/ - function () { + var INTERCOM = /*#__PURE__*/function () { function INTERCOM(config) { _classCallCheck(this, INTERCOM); @@ -6830,9 +6899,6 @@ case "anonymousId": rawPayload.user_id = value; break; - - default: - break; } } }); @@ -6873,9 +6939,7 @@ return INTERCOM; }(); - var Keen = - /*#__PURE__*/ - function () { + var Keen = /*#__PURE__*/function () { function Keen(config) { _classCallCheck(this, Keen); @@ -7218,9 +7282,7 @@ var objCase_2 = objCase.replace; var objCase_3 = objCase.del; - var Kissmetrics = - /*#__PURE__*/ - function () { + var Kissmetrics = /*#__PURE__*/function () { function Kissmetrics(config) { _classCallCheck(this, Kissmetrics); @@ -7509,9 +7571,7 @@ return Kissmetrics; }(); - var CustomerIO = - /*#__PURE__*/ - function () { + var CustomerIO = /*#__PURE__*/function () { function CustomerIO(config) { _classCallCheck(this, CustomerIO); @@ -7644,9 +7704,7 @@ callback(document.body); } - var Chartbeat = - /*#__PURE__*/ - function () { + var Chartbeat = /*#__PURE__*/function () { function Chartbeat(config, analytics) { _classCallCheck(this, Chartbeat); @@ -7819,9 +7877,7 @@ return Chartbeat; }(); - var Comscore = - /*#__PURE__*/ - function () { + var Comscore = /*#__PURE__*/function () { function Comscore(config, analytics) { _classCallCheck(this, Comscore); @@ -7977,9 +8033,7 @@ return Comscore; }(); - var FacebookPixel = - /*#__PURE__*/ - function () { + var FacebookPixel = /*#__PURE__*/function () { function FacebookPixel(config) { _classCallCheck(this, FacebookPixel); @@ -8235,7 +8289,7 @@ var contents = []; for (var i = 0; i < products.length; i++) { - var pId = product.product_id; + var pId = products[i].product_id; contentIds.push(pId); var content = { id: pId, @@ -8291,8 +8345,8 @@ var contents = []; for (var i = 0; i < products.length; i++) { - var _product = products[i]; - var pId = _product.product_id; + var product = products[i]; + var pId = product.product_id; contentIds.push(pId); var content = { id: pId, @@ -11941,14 +11995,14 @@ (function () { // Detect the `define` function exposed by asynchronous module loaders. The // strict `define` check is necessary for compatibility with `r.js`. - var isLoader = typeof undefined === "function" && undefined.amd; // A set of types used to distinguish objects from primitives. + var isLoader = typeof undefined === "function" ; // A set of types used to distinguish objects from primitives. var objectTypes = { "function": true, "object": true }; // Detect the `exports` object exposed by CommonJS implementations. - var freeExports = exports && !exports.nodeType && exports; // Use the `global` object exposed by Node (including Browserify via + var freeExports = objectTypes['object'] && exports && !exports.nodeType && exports; // Use the `global` object exposed by Node (including Browserify via // `insert-module-globals`), Narwhal, and Ringo as the default context, // and the `window` object in browsers. Rhino exports a `global` function // instead. @@ -12973,130 +13027,6 @@ }).call(commonjsGlobal); }); - /** - * Helpers. - */ - var s$1 = 1000; - var m$1 = s$1 * 60; - var h$1 = m$1 * 60; - var d$1 = h$1 * 24; - var y$1 = d$1 * 365.25; - /** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @return {String|Number} - * @api public - */ - - var ms$1 = function ms(val, options) { - options = options || {}; - if ('string' == typeof val) return parse$4(val); - return options["long"] ? _long$1(val) : _short$1(val); - }; - /** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - - - function parse$4(str) { - str = '' + str; - if (str.length > 10000) return; - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); - if (!match) return; - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y$1; - - case 'days': - case 'day': - case 'd': - return n * d$1; - - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h$1; - - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m$1; - - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s$1; - - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - } - } - /** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function _short$1(ms) { - if (ms >= d$1) return Math.round(ms / d$1) + 'd'; - if (ms >= h$1) return Math.round(ms / h$1) + 'h'; - if (ms >= m$1) return Math.round(ms / m$1) + 'm'; - if (ms >= s$1) return Math.round(ms / s$1) + 's'; - return ms + 'ms'; - } - /** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - - - function _long$1(ms) { - return plural$1(ms, d$1, 'day') || plural$1(ms, h$1, 'hour') || plural$1(ms, m$1, 'minute') || plural$1(ms, s$1, 'second') || ms + ' ms'; - } - /** - * Pluralization helper. - */ - - - function plural$1(ms, n, name) { - if (ms < n) return; - if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; - return Math.ceil(ms / n) + ' ' + name + 's'; - } - var debug_1$1 = createCommonjsModule(function (module, exports) { /** * This is the common logic for both the Node.js and web browser @@ -13109,7 +13039,7 @@ exports.disable = disable; exports.enable = enable; exports.enabled = enabled; - exports.humanize = ms$1; + exports.humanize = ms; /** * The currently active debug mode names, and names to skip. */ @@ -13520,7 +13450,7 @@ return {}; } - return parse$5(str); + return parse$4(str); } /** * Get cookie `name`. @@ -13543,7 +13473,7 @@ */ - function parse$5(str) { + function parse$4(str) { var obj = {}; var pairs = str.split(/ *; */); var pair; @@ -13684,9 +13614,7 @@ * An object utility to persist values in cookies */ - var CookieLocal = - /*#__PURE__*/ - function () { + var CookieLocal = /*#__PURE__*/function () { function CookieLocal(options) { _classCallCheck(this, CookieLocal); @@ -13990,9 +13918,7 @@ * An object utility to persist user and other values in localstorage */ - var StoreLocal = - /*#__PURE__*/ - function () { + var StoreLocal = /*#__PURE__*/function () { function StoreLocal(options) { _classCallCheck(this, StoreLocal); @@ -14073,9 +13999,7 @@ * An object that handles persisting key-val from Analytics */ - var Storage = - /*#__PURE__*/ - function () { + var Storage = /*#__PURE__*/function () { function Storage() { _classCallCheck(this, Storage); @@ -14327,9 +14251,7 @@ lotame_synch_time_key: "lt_synch_timestamp" }; - var LotameStorage = - /*#__PURE__*/ - function () { + var LotameStorage = /*#__PURE__*/function () { function LotameStorage() { _classCallCheck(this, LotameStorage); @@ -14353,9 +14275,7 @@ var lotameStorage = new LotameStorage(); - var Lotame = - /*#__PURE__*/ - function () { + var Lotame = /*#__PURE__*/function () { function Lotame(config, analytics) { var _this = this; @@ -14420,7 +14340,7 @@ if (this.dspUrlSettingsPixel && this.dspUrlSettingsPixel.length > 0) { var currentTime = Date.now(); this.dspUrlSettingsPixel.forEach(function (urlSettings) { - var dspUrl = _this2.compileUrl(_objectSpread2({}, _this2.mappings, { + var dspUrl = _this2.compileUrl(_objectSpread2(_objectSpread2({}, _this2.mappings), {}, { userId: userId, random: currentTime }), urlSettings.dspUrlTemplate); @@ -14435,7 +14355,7 @@ var _currentTime = Date.now(); this.dspUrlSettingsIframe.forEach(function (urlSettings) { - var dspUrl = _this2.compileUrl(_objectSpread2({}, _this2.mappings, { + var dspUrl = _this2.compileUrl(_objectSpread2(_objectSpread2({}, _this2.mappings), {}, { userId: userId, random: _currentTime }), urlSettings.dspUrlTemplate); @@ -14487,7 +14407,7 @@ if (this.bcpUrlSettingsPixel && this.bcpUrlSettingsPixel.length > 0) { var currentTime = Date.now(); this.bcpUrlSettingsPixel.forEach(function (urlSettings) { - var bcpUrl = _this3.compileUrl(_objectSpread2({}, _this3.mappings, { + var bcpUrl = _this3.compileUrl(_objectSpread2(_objectSpread2({}, _this3.mappings), {}, { random: currentTime }), urlSettings.bcpUrlTemplate); @@ -14501,7 +14421,7 @@ var _currentTime2 = Date.now(); this.bcpUrlSettingsIframe.forEach(function (urlSettings) { - var bcpUrl = _this3.compileUrl(_objectSpread2({}, _this3.mappings, { + var bcpUrl = _this3.compileUrl(_objectSpread2(_objectSpread2({}, _this3.mappings), {}, { random: _currentTime2 }), urlSettings.bcpUrlTemplate); @@ -14542,9 +14462,7 @@ return Lotame; }(); - var Optimizely = - /*#__PURE__*/ - function () { + var Optimizely = /*#__PURE__*/function () { function Optimizely(config, analytics) { var _this = this; @@ -14794,9 +14712,7 @@ return Optimizely; }(); - var Bugsnag = - /*#__PURE__*/ - function () { + var Bugsnag = /*#__PURE__*/function () { function Bugsnag(config) { _classCallCheck(this, Bugsnag); @@ -14851,7 +14767,7 @@ return Bugsnag; }(); - var preserveCamelCase = function preserveCamelCase(string) { + var preserveCamelCase = function preserveCamelCase(string, locale) { var isLastCharLower = false; var isLastCharUpper = false; var isLastLastCharUpper = false; @@ -14859,39 +14775,50 @@ for (var i = 0; i < string.length; i++) { var character = string[i]; - if (isLastCharLower && /[Lpu\{\}]/.test(character)) { + if (isLastCharLower && /(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C2\uA7C4-\uA7C7\uA7C9\uA7F5\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])/.test(character)) { string = string.slice(0, i) + '-' + string.slice(i); isLastCharLower = false; isLastLastCharUpper = isLastCharUpper; isLastCharUpper = true; i++; - } else if (isLastCharUpper && isLastLastCharUpper && /[Llp\{\}]/.test(character)) { + } else if (isLastCharUpper && isLastLastCharUpper && /(?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C3\uA7C8\uA7CA\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])/.test(character)) { string = string.slice(0, i - 1) + '-' + string.slice(i - 1); isLastLastCharUpper = isLastCharUpper; isLastCharUpper = false; isLastCharLower = true; } else { - isLastCharLower = character.toLocaleLowerCase() === character && character.toLocaleUpperCase() !== character; + isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character; isLastLastCharUpper = isLastCharUpper; - isLastCharUpper = character.toLocaleUpperCase() === character && character.toLocaleLowerCase() !== character; + isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character; } } return string; }; + var preserveConsecutiveUppercase = function preserveConsecutiveUppercase(input) { + return input.replace(/^(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C2\uA7C4-\uA7C7\uA7C9\uA7F5\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21])(?!(?:[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C2\uA7C4-\uA7C7\uA7C9\uA7F5\uFF21-\uFF3A]|\uD801[\uDC00-\uDC27\uDCB0-\uDCD3]|\uD803[\uDC80-\uDCB2]|\uD806[\uDCA0-\uDCBF]|\uD81B[\uDE40-\uDE5F]|\uD835[\uDC00-\uDC19\uDC34-\uDC4D\uDC68-\uDC81\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB5\uDCD0-\uDCE9\uDD04\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD38\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD6C-\uDD85\uDDA0-\uDDB9\uDDD4-\uDDED\uDE08-\uDE21\uDE3C-\uDE55\uDE70-\uDE89\uDEA8-\uDEC0\uDEE2-\uDEFA\uDF1C-\uDF34\uDF56-\uDF6E\uDF90-\uDFA8\uDFCA]|\uD83A[\uDD00-\uDD21]))/g, function (m1) { + return m1.toLowerCase(); + }); + }; + + var postProcess = function postProcess(input, options) { + return input.replace(/[ \x2D\._]+((?:[0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u0669\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u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u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1ABF\u1AC0\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B50-\u1B59\u1B80-\u1BA9\u1BAC-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C36\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2189\u2150-\u2182\u2460-\u249B\u24B6-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA805\uA807-\uA827\uA830-\uA835\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDF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uDF39\uDF3D-\uDF44\uDF47\uDF48\uDF4B\uDF4C\uDF50\uDF57\uDF5D-\uDF63]|\uD805[\uDC00-\uDC41\uDC43-\uDC45\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCC1\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDBE\uDDD8-\uDDDD\uDE00-\uDE3E\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB5\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC38\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B\uDD3C\uDD3F-\uDD42\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDDF\uDDE1\uDDE3\uDDE4\uDE00-\uDE32\uDE35-\uDE3E\uDE50-\uDE97\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC3E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD41\uDD43\uDD46\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE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03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])|$)/g, function (_, p1) { + return p1.toLocaleUpperCase(options.locale); + }).replace(/[0-9]+((?:[0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0345\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05B0-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0657\u0659-\u0669\u066E-\u06D3\u06D5-\u06DC\u06E1-\u06E8\u06ED-\u06FC\u06FF\u0710-\u073F\u074D-\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0817\u081A-\u082C\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D4-\u08DF\u08E3-\u08E9\u08F0-\u093B\u093D-\u094C\u094E-\u0950\u0955-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C4\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A42\u0A47\u0A48\u0A4B\u0A4C\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC5\u0AC7-\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFC\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D-\u0B44\u0B47\u0B48\u0B4B\u0B4C\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4C\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCC\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D54-\u0D63\u0D66-\u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E46\u0E4D\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F71-\u0F81\u0F88-\u0F97\u0F99-\u0FBC\u1000-\u1036\u1038\u103B-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1713\u1720-\u1733\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17B3\u17B6-\u17C8\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A61-\u1A74\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1ABF\u1AC0\u1B00-\u1B33\u1B35-\u1B43\u1B45-\u1B4B\u1B50-\u1B59\u1B80-\u1BA9\u1BAC-\u1BE5\u1BE7-\u1BF1\u1C00-\u1C36\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1DE7-\u1DF4\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2189\u2150-\u2182\u2460-\u249B\u24B6-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA674-\uA67B\uA67F-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA805\uA807-\uA827\uA830-\uA835\uA840-\uA873\uA880-\uA8C3\uA8C5\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD-\uA92A\uA930-\uA952\uA960-\uA97C\uA980-\uA9B2\uA9B4-\uA9BF\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAABE\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A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D59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD96\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9E]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD47\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C\uDD30-\uDD49\uDD50-\uDD69\uDD70-\uDD89]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])|$)/g, function (m) { + return m.toLocaleUpperCase(options.locale); + }); + }; + var camelCase = function camelCase(input, options) { if (!(typeof input === 'string' || Array.isArray(input))) { throw new TypeError('Expected the input to be `string | string[]`'); } - options = _objectSpread2({}, { - pascalCase: false - }, {}, options); - - var postProcess = function postProcess(x) { - return options.pascalCase ? x.charAt(0).toLocaleUpperCase() + x.slice(1) : x; - }; + options = _objectSpread2({ + pascalCase: false, + preserveConsecutiveUppercase: false + }, options); if (Array.isArray(input)) { input = input.map(function (x) { @@ -14908,21 +14835,28 @@ } if (input.length === 1) { - return options.pascalCase ? input.toLocaleUpperCase() : input.toLocaleLowerCase(); + return options.pascalCase ? input.toLocaleUpperCase(options.locale) : input.toLocaleLowerCase(options.locale); } - var hasUpperCase = input !== input.toLocaleLowerCase(); + var hasUpperCase = input !== input.toLocaleLowerCase(options.locale); if (hasUpperCase) { - input = preserveCamelCase(input); + input = preserveCamelCase(input, options.locale); } - input = input.replace(/^[_.\- ]+/, '').toLocaleLowerCase().replace(/[ \x2D\._]+([AN_ahlp\{\}]|$)/g, function (_, p1) { - return p1.toLocaleUpperCase(); - }).replace(/[0-9]+([AN_ahlp\{\}]|$)/g, function (m) { - return m.toLocaleUpperCase(); - }); - return postProcess(input); + input = input.replace(/^[_.\- ]+/, ''); + + if (options.preserveConsecutiveUppercase) { + input = preserveConsecutiveUppercase(input); + } else { + input = input.toLocaleLowerCase(); + } + + if (options.pascalCase) { + input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1); + } + + return postProcess(input, options); }; var camelcase = camelCase; // TODO: Remove this for the next major release @@ -14930,9 +14864,7 @@ var default_1 = camelCase; camelcase["default"] = default_1; - var Fullstory = - /*#__PURE__*/ - function () { + var Fullstory = /*#__PURE__*/function () { function Fullstory(config) { _classCallCheck(this, Fullstory); @@ -15090,8 +15022,6 @@ case "bools": return "".concat(camelcase(parts.join("_")), "_").concat(typeSuffix); - default: // passthrough - } } // No type suffix found. Camel case the whole field name. @@ -15103,9 +15033,7 @@ return Fullstory; }(); - var TVSquared = - /*#__PURE__*/ - function () { + var TVSquared = /*#__PURE__*/function () { function TVSquared(config) { _classCallCheck(this, TVSquared); @@ -15595,7 +15523,7 @@ // get the dest keys from itemParameters config // append the already created item object keys (this is done to get the keys that are actually top level props in Rudder payload but GA expects them under items too) products.forEach(function (p) { - obj = _objectSpread2({}, getDestinationEventProperties(p, itemParametersConfigArray), {}, item && type(item) === "array" && item[0] || {}); + obj = _objectSpread2(_objectSpread2({}, getDestinationEventProperties(p, itemParametersConfigArray)), item && type(item) === "array" && item[0] || {}); items.push(obj); }); } @@ -15612,9 +15540,7 @@ return getDestinationEventProperties(props, pageEventParametersConfigArray); } - var GA4 = - /*#__PURE__*/ - function () { + var GA4 = /*#__PURE__*/function () { function GA4(config, analytics) { _classCallCheck(this, GA4); @@ -15821,7 +15747,7 @@ pageProps = flattenJsonPayload(pageProps); if (this.extendPageViewParams) { - window.gtag("event", "page_view", _objectSpread2({}, pageProps, {}, getPageViewProperty(pageProps))); + window.gtag("event", "page_view", _objectSpread2(_objectSpread2({}, pageProps), getPageViewProperty(pageProps))); } else { window.gtag("event", "page_view", getPageViewProperty(pageProps)); } @@ -15846,9 +15772,7 @@ id: null }; - var MoEngage = - /*#__PURE__*/ - function () { + var MoEngage = /*#__PURE__*/function () { function MoEngage(config, analyticsinstance) { _classCallCheck(this, MoEngage); @@ -16025,9 +15949,7 @@ return MoEngage; }(); - var Amplitude = - /*#__PURE__*/ - function () { + var Amplitude = /*#__PURE__*/function () { function Amplitude(config, analytics) { var _this = this; @@ -16078,91 +16000,93 @@ _createClass(Amplitude, [{ key: "init", value: function init() { - (function (e, t) { - var n = e.amplitude || { - _q: [], - _iq: {} - }; - var r = t.createElement("script"); - r.type = "text/javascript"; - r.integrity = "sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M"; - r.crossOrigin = "anonymous"; - r.async = true; - r.src = "https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js"; - - r.onload = function () { - if (!e.amplitude.runQueuedFunctions) { - console.log("[Amplitude] Error: could not load SDK"); - } - }; + if (this.analytics.loadIntegration) { + (function (e, t) { + var n = e.amplitude || { + _q: [], + _iq: {} + }; + var r = t.createElement("script"); + r.type = "text/javascript"; + r.integrity = "sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M"; + r.crossOrigin = "anonymous"; + r.async = true; + r.src = "https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js"; + + r.onload = function () { + if (!e.amplitude.runQueuedFunctions) { + console.log("[Amplitude] Error: could not load SDK"); + } + }; - var i = t.getElementsByTagName("script")[0]; - i.parentNode.insertBefore(r, i); + var i = t.getElementsByTagName("script")[0]; + i.parentNode.insertBefore(r, i); - function s(e, t) { - e.prototype[t] = function () { - this._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + function s(e, t) { + e.prototype[t] = function () { + this._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + + return this; + }; + } + var o = function o() { + this._q = []; return this; }; - } - - var o = function o() { - this._q = []; - return this; - }; - var a = ["add", "append", "clearAll", "prepend", "set", "setOnce", "unset"]; + var a = ["add", "append", "clearAll", "prepend", "set", "setOnce", "unset"]; - for (var c = 0; c < a.length; c++) { - s(o, a[c]); - } + for (var c = 0; c < a.length; c++) { + s(o, a[c]); + } - n.Identify = o; + n.Identify = o; - var u = function u() { - this._q = []; - return this; - }; + var u = function u() { + this._q = []; + return this; + }; - var l = ["setProductId", "setQuantity", "setPrice", "setRevenueType", "setEventProperties"]; + var l = ["setProductId", "setQuantity", "setPrice", "setRevenueType", "setEventProperties"]; - for (var p = 0; p < l.length; p++) { - s(u, l[p]); - } + for (var p = 0; p < l.length; p++) { + s(u, l[p]); + } - n.Revenue = u; - var d = ["init", "logEvent", "logRevenue", "setUserId", "setUserProperties", "setOptOut", "setVersionName", "setDomain", "setDeviceId", "enableTracking", "setGlobalUserProperties", "identify", "clearUserProperties", "setGroup", "logRevenueV2", "regenerateDeviceId", "groupIdentify", "onInit", "logEventWithTimestamp", "logEventWithGroups", "setSessionId", "resetSessionId"]; + n.Revenue = u; + var d = ["init", "logEvent", "logRevenue", "setUserId", "setUserProperties", "setOptOut", "setVersionName", "setDomain", "setDeviceId", "enableTracking", "setGlobalUserProperties", "identify", "clearUserProperties", "setGroup", "logRevenueV2", "regenerateDeviceId", "groupIdentify", "onInit", "logEventWithTimestamp", "logEventWithGroups", "setSessionId", "resetSessionId"]; - function v(e) { - function t(t) { - e[t] = function () { - e._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); - }; - } + function v(e) { + function t(t) { + e[t] = function () { + e._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + }; + } - for (var _n = 0; _n < d.length; _n++) { - t(d[_n]); + for (var _n = 0; _n < d.length; _n++) { + t(d[_n]); + } } - } - v(n); + v(n); - n.getInstance = function (e) { - e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase(); + n.getInstance = function (e) { + e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase(); - if (!n._iq.hasOwnProperty(e)) { - n._iq[e] = { - _q: [] - }; - v(n._iq[e]); - } + if (!n._iq.hasOwnProperty(e)) { + n._iq[e] = { + _q: [] + }; + v(n._iq[e]); + } - return n._iq[e]; - }; + return n._iq[e]; + }; - e.amplitude = n; - })(window, document); + e.amplitude = n; + })(window, document); + } var initOptions = { includeUtm: this.trackUtmProperties, @@ -16477,9 +16401,7 @@ return Amplitude; }(); - var Pendo = - /*#__PURE__*/ - function () { + var Pendo = /*#__PURE__*/function () { function Pendo(config, analytics) { _classCallCheck(this, Pendo); @@ -16601,7 +16523,7 @@ userId = _rudderElement$messag.userId, traits = _rudderElement$messag.traits; accountObj.id = this.analytics.groupId || this.analytics.anonymousId; - accountObj = _objectSpread2({}, accountObj, {}, traits); + accountObj = _objectSpread2(_objectSpread2({}, accountObj), traits); if (userId) { visitorObj = _objectSpread2({ @@ -16634,9 +16556,7 @@ return Pendo; }(); - var Lytics = - /*#__PURE__*/ - function () { + var Lytics = /*#__PURE__*/function () { function Lytics(config) { _classCallCheck(this, Lytics); @@ -16761,9 +16681,7 @@ return Lytics; }(); - var Appcues = - /*#__PURE__*/ - function () { + var Appcues = /*#__PURE__*/function () { function Appcues(config) { _classCallCheck(this, Appcues); @@ -16842,52 +16760,217 @@ return Appcues; }(); - // (config-plan name, native destination.name , exported integration name(this one below)) + var Posthog = /*#__PURE__*/function () { + function Posthog(config, analytics) { + var _this = this; - var integrations = { - HS: index, - GA: index$1, - HOTJAR: index$2, - GOOGLEADS: index$3, - VWO: VWO, - GTM: GoogleTagManager, - BRAZE: Braze, - INTERCOM: INTERCOM, - KEEN: Keen, - KISSMETRICS: Kissmetrics, - CUSTOMERIO: CustomerIO, - CHARTBEAT: Chartbeat, - COMSCORE: Comscore, - FACEBOOK_PIXEL: FacebookPixel, - LOTAME: Lotame, - OPTIMIZELY: Optimizely, - BUGSNAG: Bugsnag, - FULLSTORY: Fullstory, - TVSQUARED: TVSquared, - GA4: GA4, - MOENGAGE: MoEngage, - AM: Amplitude, - PENDO: Pendo, - LYTICS: Lytics, - APPCUES: Appcues - }; + _classCallCheck(this, Posthog); - // Application class - var RudderApp = function RudderApp() { - _classCallCheck(this, RudderApp); + this.name = "POSTHOG"; + this.analytics = analytics; + this.teamApiKey = config.teamApiKey; + this.yourInstance = config.yourInstance || "https://app.posthog.com"; + this.autocapture = config.autocapture || false; + this.capturePageView = config.capturePageView || false; + this.disableSessionRecording = config.disableSessionRecording || false; + this.disableCookie = config.disableCookie || false; + this.propertyBlackList = []; + this.xhrHeaders = {}; + + if (config.xhrHeaders && config.xhrHeaders.length > 0) { + config.xhrHeaders.forEach(function (header) { + if (header && header.key && header.value && header.key.trim() != "" && header.value.trim() != "") { + _this.xhrHeaders[header.key] = header.value; + } + }); + } - this.build = "1.0.0"; - this.name = "RudderLabs JavaScript SDK"; - this.namespace = "com.rudderlabs.javascript"; - this.version = "1.0.14"; - }; + if (config.propertyBlackList && config.propertyBlackList.length > 0) { + config.propertyBlackList.forEach(function (element) { + if (element && element.property && element.property.trim() != "") { + _this.propertyBlackList.push(element.property); + } + }); + } + } - // Library information class - var RudderLibraryInfo = function RudderLibraryInfo() { - _classCallCheck(this, RudderLibraryInfo); + _createClass(Posthog, [{ + key: "init", + value: function init() { + !function (t, e) { + var o, n, p, r; + e.__SV || (window.posthog = e, e._i = [], e.init = function (i, s, a) { + function g(t, e) { + var o = e.split("."); + 2 == o.length && (t = t[o[0]], e = o[1]), t[e] = function () { + t.push([e].concat(Array.prototype.slice.call(arguments, 0))); + }; + } + + (p = t.createElement("script")).type = "text/javascript", p.async = !0, p.src = s.api_host + "/static/array.js", (r = t.getElementsByTagName("script")[0]).parentNode.insertBefore(p, r); + var u = e; + + for (void 0 !== a ? u = e[a] = [] : a = "posthog", u.people = u.people || [], u.toString = function (t) { + var e = "posthog"; + return "posthog" !== a && (e += "." + a), t || (e += " (stub)"), e; + }, u.people.toString = function () { + return u.toString(1) + ".people (stub)"; + }, o = "capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags".split(" "), n = 0; n < o.length; n++) { + g(u, o[n]); + } + + e._i.push([i, s, a]); + }, e.__SV = 1); + }(document, window.posthog || []); + var configObject = { + api_host: this.yourInstance, + autocapture: this.autocapture, + capture_pageview: this.capturePageView, + disable_session_recording: this.disableSessionRecording, + property_blacklist: this.propertyBlackList, + disable_cookie: this.disableCookie + }; + + if (this.xhrHeaders && Object.keys(this.xhrHeaders).length > 0) { + configObject.xhr_headers = this.xhrHeaders; + } + + posthog.init(this.teamApiKey, configObject); + } + /** + * superproperties should be part of rudderelement.message.integrations.POSTHOG object. + * Once we call the posthog.register api, the corresponding property will be sent along with subsequent capture calls. + * To remove the superproperties, we call unregister api. + */ + + }, { + key: "processSuperProperties", + value: function processSuperProperties(rudderElement) { + var integrations = rudderElement.message.integrations; + + if (integrations && integrations.POSTHOG) { + var _integrations$POSTHOG = integrations.POSTHOG, + superProperties = _integrations$POSTHOG.superProperties, + setOnceProperties = _integrations$POSTHOG.setOnceProperties, + unsetProperties = _integrations$POSTHOG.unsetProperties; + + if (superProperties && Object.keys(superProperties).length > 0) { + posthog.register(superProperties); + } + + if (setOnceProperties && Object.keys(setOnceProperties).length > 0) { + posthog.register_once(setOnceProperties); + } + + if (unsetProperties && unsetProperties.length > 0) { + unsetProperties.forEach(function (property) { + if (property && property.trim() != "") { + posthog.unregister(property); + } + }); + } + } + } + }, { + key: "identify", + value: function identify(rudderElement) { + logger.debug("in Posthog identify"); // rudderElement.message.context will always be present as part of identify event payload. + + var traits = rudderElement.message.context.traits; + var userId = rudderElement.message.userId; + + if (userId) { + posthog.identify(userId, traits); + } + + this.processSuperProperties(rudderElement); + } + }, { + key: "track", + value: function track(rudderElement) { + logger.debug("in Posthog track"); + var _rudderElement$messag = rudderElement.message, + event = _rudderElement$messag.event, + properties = _rudderElement$messag.properties; + this.processSuperProperties(rudderElement); + posthog.capture(event, properties); + } + /** + * + * + * @memberof Posthog + */ + + }, { + key: "page", + value: function page(rudderElement) { + logger.debug("in Posthog page"); + this.processSuperProperties(rudderElement); + posthog.capture('$pageview'); + } + }, { + key: "isLoaded", + value: function isLoaded() { + logger.debug("in Posthog isLoaded"); + return !!(window.posthog && window.posthog.__loaded); + } + }, { + key: "isReady", + value: function isReady() { + return !!(window.posthog && window.posthog.__loaded); + } + }]); + + return Posthog; + }(); + + // (config-plan name, native destination.name , exported integration name(this one below)) + + var integrations = { + HS: index, + GA: index$1, + HOTJAR: index$2, + GOOGLEADS: index$3, + VWO: VWO, + GTM: GoogleTagManager, + BRAZE: Braze, + INTERCOM: INTERCOM, + KEEN: Keen, + KISSMETRICS: Kissmetrics, + CUSTOMERIO: CustomerIO, + CHARTBEAT: Chartbeat, + COMSCORE: Comscore, + FACEBOOK_PIXEL: FacebookPixel, + LOTAME: Lotame, + OPTIMIZELY: Optimizely, + BUGSNAG: Bugsnag, + FULLSTORY: Fullstory, + TVSQUARED: TVSquared, + GA4: GA4, + MOENGAGE: MoEngage, + AM: Amplitude, + PENDO: Pendo, + LYTICS: Lytics, + APPCUES: Appcues, + POSTHOG: Posthog + }; + + // Application class + var RudderApp = function RudderApp() { + _classCallCheck(this, RudderApp); + + this.build = "1.0.0"; + this.name = "RudderLabs JavaScript SDK"; + this.namespace = "com.rudderlabs.javascript"; + this.version = "1.0.15"; + }; + + // Library information class + var RudderLibraryInfo = function RudderLibraryInfo() { + _classCallCheck(this, RudderLibraryInfo); this.name = "RudderLabs JavaScript SDK"; - this.version = "1.0.14"; + this.version = "1.0.15"; }; // Operating System information class @@ -16938,9 +17021,7 @@ this.network = null; }; - var RudderMessage = - /*#__PURE__*/ - function () { + var RudderMessage = /*#__PURE__*/function () { function RudderMessage() { _classCallCheck(this, RudderMessage); @@ -17007,8 +17088,6 @@ case ECommerceEvents.ORDER_REFUNDED: this.checkForKey("order_id"); break; - - default: } } else if (!this.properties.category) { // if category is not there, set to event @@ -17041,9 +17120,7 @@ return RudderMessage; }(); - var RudderElement = - /*#__PURE__*/ - function () { + var RudderElement = /*#__PURE__*/function () { function RudderElement() { _classCallCheck(this, RudderElement); @@ -17091,9 +17168,7 @@ return RudderElement; }(); - var RudderElementBuilder = - /*#__PURE__*/ - function () { + var RudderElementBuilder = /*#__PURE__*/function () { function RudderElementBuilder() { _classCallCheck(this, RudderElementBuilder); @@ -17173,6 +17248,44 @@ return RudderElementBuilder; }(); + var IDX = 256, + HEX = [], + BUFFER; + + while (IDX--) { + HEX[IDX] = (IDX + 256).toString(16).substring(1); + } + + function v4() { + var i = 0, + num, + out = ''; + + if (!BUFFER || IDX + 16 > 256) { + BUFFER = Array(i = 256); + + while (i--) { + BUFFER[i] = 256 * Math.random() | 0; + } + + i = IDX = 0; + } + + for (; i < 16; i++) { + num = BUFFER[IDX + i]; + if (i == 6) out += HEX[num & 15 | 64];else if (i == 8) out += HEX[num & 63 | 128];else out += HEX[num]; + if (i & 1 && i > 1 && i < 11) out += '-'; + } + + IDX++; + return out; + } + + var dist = /*#__PURE__*/Object.freeze({ + __proto__: null, + v4: v4 + }); + var rngBrowser = createCommonjsModule(function (module) { // Unique ID creation requires a high quality random # generator. In the // browser this is a little complicated due to unknown quality of Math.random() @@ -17237,7 +17350,7 @@ var _lastMSecs = 0; - var _lastNSecs = 0; // See https://github.com/broofa/node-uuid for API details + var _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details function v1(options, buf, offset) { var i = buf && offset || 0; @@ -17321,7 +17434,7 @@ var v1_1 = v1; - function v4(options, buf, offset) { + function v4$1(options, buf, offset) { var i = buf && offset || 0; if (typeof options == 'string') { @@ -17344,7 +17457,7 @@ return buf || bytesToUuid_1(rnds); } - var v4_1 = v4; + var v4_1 = v4$1; var uuid = v4_1; uuid.v1 = v1_1; @@ -17419,6 +17532,7 @@ var defaultEngine$1 = engine.defaultEngine; var inMemoryEngine$1 = engine.inMemoryEngine; + var json = JSON; /** * Store Implementation with dedicated */ @@ -17428,6 +17542,7 @@ this.name = name; this.keys = keys || {}; this.engine = optionalEngine || defaultEngine$1; + this.originalEngine = this.engine; } /** * Set value by key. @@ -17440,7 +17555,7 @@ if (!compoundKey) return; try { - this.engine.setItem(compoundKey, json3.stringify(value)); + this.engine.setItem(compoundKey, json.stringify(value)); } catch (err) { if (isQuotaExceeded(err)) { // switch to inMemory engine @@ -17464,11 +17579,19 @@ return null; } - return json3.parse(str); + return json.parse(str); } catch (err) { return null; } }; + /** + * Get original engine + */ + + + Store$1.prototype.getOriginalEngine = function () { + return this.originalEngine; + }; /** * Remove by Key. */ @@ -17531,9 +17654,6 @@ } break; - - default: - break; } } else if (e.number === -2147024882) { // Internet Explorer 8 @@ -17724,178 +17844,9 @@ if (window.localStorage) debug$2.enable(localStorage.debug); } catch (e) {} - var componentEmitter$1 = createCommonjsModule(function (module) { - /** - * Expose `Emitter`. - */ - { - module.exports = Emitter; - } - /** - * Initialize a new `Emitter`. - * - * @api public - */ - - - function Emitter(obj) { - if (obj) return mixin(obj); - } - /** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - - function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - - return obj; - } - /** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - - - Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) { - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn); - return this; - }; - /** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - - - Emitter.prototype.once = function (event, fn) { - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; - }; - /** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - - - Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) { - this._callbacks = this._callbacks || {}; // all - - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } // specific event - - - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; // remove all handlers - - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } // remove specific handler - - - var cb; - - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - - - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; - }; - /** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - - - Emitter.prototype.emit = function (event) { - this._callbacks = this._callbacks || {}; - var args = new Array(arguments.length - 1), - callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; - }; - /** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - - - Emitter.prototype.listeners = function (event) { - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; - }; - /** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - + var require$$0 = getCjsExportFromNamespace(dist); - Emitter.prototype.hasListeners = function (event) { - return !!this.listeners(event).length; - }; - }); - - var uuid$2 = uuid_1.v4; + var uuid$2 = require$$0.v4; var debug$3 = debug_1$2('localstorage-retry'); // Some browsers don't support Function.prototype.bind, so just including a simplified version here function bind(func, obj) { @@ -17943,9 +17894,9 @@ this.keys = { IN_PROGRESS: 'inProgress', QUEUE: 'queue', - ACK: 'ack', RECLAIM_START: 'reclaimStart', - RECLAIM_END: 'reclaimEnd' + RECLAIM_END: 'reclaimEnd', + ACK: 'ack' }; this._schedule = new schedule(); this._processId = 0; // Set up our empty queues @@ -17967,7 +17918,7 @@ */ - componentEmitter$1(Queue.prototype); + componentEmitter(Queue.prototype); /** * Starts processing the queue */ @@ -18180,7 +18131,8 @@ function findOtherQueues(name) { var res = []; - var storage = self._store.engine; + + var storage = self._store.getOriginalEngine(); for (var i = 0; i < storage.length; i++) { var k = storage.key(i); @@ -18236,11 +18188,11 @@ this._store.set(this.keys.QUEUE, our.queue); // remove all keys - other.remove(this.keys.ACK); + other.remove(this.keys.IN_PROGRESS); + other.remove(this.keys.QUEUE); other.remove(this.keys.RECLAIM_START); other.remove(this.keys.RECLAIM_END); - other.remove(this.keys.IN_PROGRESS); - other.remove(this.keys.QUEUE); // process the new items we claimed + other.remove(this.keys.ACK); // process the new items we claimed this._processHead(); }; @@ -18271,9 +18223,7 @@ * in batch and maintains order of the event. */ - var EventRepository = - /*#__PURE__*/ - function () { + var EventRepository = /*#__PURE__*/function () { /** *Creates an instance of EventRepository. * @memberof EventRepository @@ -18455,16 +18405,637 @@ var eventRepository = new EventRepository(); function addDomEventHandlers(rudderanalytics) { - logger.error("[AutoTrack]: This functionality has been moved to a different deployment"); - } + var handler = function handler(e) { + e = e || window.event; + var target = e.target || e.srcElement; - var queryDefaults = { - trait: "ajs_trait_", - prop: "ajs_prop_" - }; // https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js + if (isTextNode(target)) { + target = target.parentNode; + } - /** - * Add the rudderelement object to flush queue + if (shouldTrackDomEvent(target, e)) { + logger.debug("to be tracked ", e.type); + } else { + logger.debug("not to be tracked ", e.type); + } + + trackWindowEvent(e, rudderanalytics); + }; + + register_event(document, "submit", handler, true); + register_event(document, "change", handler, true); + register_event(document, "click", handler, true); + rudderanalytics.page(); + } + + function register_event(element, type, handler, useCapture) { + if (!element) { + logger.error("[Autotrack] register_event:: No valid element provided to register_event"); + return; + } + + element.addEventListener(type, handler, !!useCapture); + } + + function shouldTrackDomEvent(el, event) { + if (!el || isTag(el, "html") || !isElementNode(el)) { + return false; + } + + var tag = el.tagName.toLowerCase(); + + switch (tag) { + case "html": + return false; + + case "form": + return event.type === "submit"; + + case "input": + if (["button", "submit"].indexOf(el.getAttribute("type")) === -1) { + return event.type === "change"; + } + + return event.type === "click"; + + case "select": + case "textarea": + return event.type === "change"; + + default: + return event.type === "click"; + } + } + + function isTag(el, tag) { + return el && el.tagName && el.tagName.toLowerCase() === tag.toLowerCase(); + } + + function isElementNode(el) { + return el && el.nodeType === 1; // Node.ELEMENT_NODE - use integer constant for browser portability + } + + function isTextNode(el) { + return el && el.nodeType === 3; // Node.TEXT_NODE - use integer constant for browser portability + } // excerpt from https://github.com/mixpanel/mixpanel-js/blob/master/src/autotrack-utils.js + + + function shouldTrackElement(el) { + if (!el.parentNode || isTag(el, "body")) return false; + var curEl = el; + + while (curEl.parentNode && !isTag(curEl, "body")) { + var _classes = getClassName(el).split(" "); // if explicitly specified "rudder-no-track", even at parent level, dont track the child nodes too. + + + if (_classes.indexOf("rudder-no-track") >= 0) { + return false; + } + + curEl = curEl.parentNode; + } // if explicitly set "rudder-include", at element level, then track the element even if the element is hidden or sensitive. + + + var classes = getClassName(el).split(" "); + + if (classes.indexOf("rudder-include") >= 0) { + return true; + } // for general elements, do not track input/select/textarea(s) + + + if (isTag(el, "input") || isTag(el, "select") || isTag(el, "textarea") || el.getAttribute("contenteditable") === "true") { + return false; + } else if (el.getAttribute("contenteditable") === "inherit") { + for (curEl = el.parentNode; curEl.parentNode && !isTag(curEl, "body"); curEl = curEl.parentNode) { + if (curEl.getAttribute("contenteditable") === "true") { + return false; + } + } + } // do not track hidden/password elements + + + var type = el.type || ""; + + if (typeof type === "string") { + // it's possible for el.type to be a DOM element if el is a form with a child input[name="type"] + switch (type.toLowerCase()) { + case "hidden": + return false; + + case "password": + return false; + } + } // filter out data from fields that look like sensitive field - + // safeguard - match with regex with possible strings as id or name of an element for creditcard, password, ssn, pan, adhar + + + var name = el.name || el.id || ""; + + if (typeof name === "string") { + // it's possible for el.name or el.id to be a DOM element if el is a form with a child input[name="name"] + var sensitiveNameRegex = /^adhar|cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pan|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i; + + if (sensitiveNameRegex.test(name.replace(/[^a-zA-Z0-9]/g, ""))) { + return false; + } + } + + return true; + } + + function getClassName(el) { + switch (_typeof(el.className)) { + case "string": + return el.className; + + case "object": + // handle cases where className might be SVGAnimatedString or some other type + return el.className.baseVal || el.getAttribute("class") || ""; + + default: + // future proof + return ""; + } + } + + function trackWindowEvent(e, rudderanalytics) { + var target = e.target || e.srcElement; + var formValues; + + if (isTextNode(target)) { + target = target.parentNode; + } + + if (shouldTrackDomEvent(target, e)) { + if (target.tagName.toLowerCase() == "form") { + formValues = {}; + + for (var i = 0; i < target.elements.length; i++) { + var formElement = target.elements[i]; + + if (shouldTrackElement(formElement) && isValueToBeTrackedFromTrackingList(formElement, rudderanalytics.trackValues)) { + var name = formElement.id ? formElement.id : formElement.name; + + if (name && typeof name === "string") { + var key = formElement.id ? formElement.id : formElement.name; // formElement.value gives the same thing + + var value = formElement.id ? document.getElementById(formElement.id).value : document.getElementsByName(formElement.name)[0].value; + + if (formElement.type === "checkbox" || formElement.type === "radio") { + value = formElement.checked; + } + + if (key.trim() !== "") { + formValues[encodeURIComponent(key)] = encodeURIComponent(value); + } + } + } + } + } + + var targetElementList = []; + var curEl = target; + + if (isExplicitNoTrack(curEl)) { + return false; + } + + while (curEl.parentNode && !isTag(curEl, "body")) { + if (shouldTrackElement(curEl)) { + targetElementList.push(curEl); + } + + curEl = curEl.parentNode; + } + + var elementsJson = []; + var href; + targetElementList.forEach(function (el) { + // if the element or a parent element is an anchor tag + // include the href as a property + if (el.tagName.toLowerCase() === "a") { + href = el.getAttribute("href"); + href = isValueToBeTracked(href) && href; + } + + elementsJson.push(getPropertiesFromElement(el, rudderanalytics)); + }); + + if (targetElementList && targetElementList.length == 0) { + return false; + } + + var elementText = ""; + var text = getText(target); + + if (text && text.length) { + elementText = text; + } + + var props = { + event_type: e.type, + page: getDefaultPageProperties(), + elements: elementsJson, + el_attr_href: href, + el_text: elementText + }; + + if (formValues) { + props.form_values = formValues; + } + + logger.debug("web_event", props); + rudderanalytics.track("autotrack", props); + return true; + } + } + + function isExplicitNoTrack(el) { + var classes = getClassName(el).split(" "); + + if (classes.indexOf("rudder-no-track") >= 0) { + return true; + } + + return false; + } // excerpt from https://github.com/mixpanel/mixpanel-js/blob/master/src/autotrack-utils.js + + + function isValueToBeTracked(value) { + if (value === null || value === undefined) { + return false; + } + + if (typeof value === "string") { + value = value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); // check to see if input value looks like a credit card number + // see: https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9781449327453/ch04s20.html + + var ccRegex = /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/; + + if (ccRegex.test((value || "").replace(/[- ]/g, ""))) { + return false; + } // check to see if input value looks like a social security number + + + var ssnRegex = /(^\d{3}-?\d{2}-?\d{4}$)/; + + if (ssnRegex.test(value)) { + return false; + } // check to see if input value looks like a adhar number + + + var adharRegex = /(^\d{4}-?\d{4}-?\d{4}$)/; + + if (adharRegex.test(value)) { + return false; + } // check to see if input value looks like a PAN number + + + var panRegex = /(^\w{5}-?\d{4}-?\w{1}$)/; + + if (panRegex.test(value)) { + return false; + } + } + + return true; + } // if the element name is provided in the valTrackingList while loading rudderanalytics, track the value. + + /** + * + * @param {*} el + * @param {*} includeList - valTrackingList provided in rudderanalytics.load() + */ + + + function isValueToBeTrackedFromTrackingList(el, includeList) { + var elAttributesLength = el.attributes.length; + + for (var i = 0; i < elAttributesLength; i++) { + var value = el.attributes[i].value; + + if (includeList.indexOf(value) > -1) { + return true; + } + } + + return false; + } + + function getText(el) { + var text = ""; + el.childNodes.forEach(function (value) { + if (value.nodeType === Node.TEXT_NODE) { + var textContent = value.nodeValue.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); // take each word from the text content and check whether the value should be tracked. Also, replace the whitespaces. + + var textValue = textContent.split(/(\s+)/).filter(isValueToBeTracked).join("").replace(/[\r\n]/g, " "); + text += textValue; + } + }); + return text.trim(); + } + + function getPropertiesFromElement(elem, rudderanalytics) { + var props = { + classes: getClassName(elem).split(" "), + tag_name: elem.tagName.toLowerCase() + }; + var attrLength = elem.attributes.length; + + for (var i = 0; i < attrLength; i++) { + var name = elem.attributes[i].name; + var value = elem.attributes[i].value; + + if (value && isValueToBeTracked(value)) { + props["attr__".concat(name)] = value; + } + + if ((name == "name" || name == "id") && isValueToBeTrackedFromTrackingList(elem, rudderanalytics.trackValues)) { + props.field_value = name == "id" ? document.getElementById(value).value : document.getElementsByName(value)[0].value; + + if (elem.type === "checkbox" || elem.type === "radio") { + props.field_value = elem.checked; + } + } + } + + var nthChild = 1; + var nthOfType = 1; + var currentElem = elem; + + while (currentElem = previousElementSibling(currentElem)) { + nthChild++; + + if (currentElem.tagName === elem.tagName) { + nthOfType++; + } + } + + props.nth_child = nthChild; + props.nth_of_type = nthOfType; + return props; + } + + function previousElementSibling(el) { + if (el.previousElementSibling) { + return el.previousElementSibling; + } + + do { + el = el.previousSibling; + } while (el && !isElementNode(el)); + + return el; + } + + /** + * @description This is utility function for crc32 algorithm + * @version v1.0.0 + */ + + /** + * @description generate crc table + * @params none + * @returns arrray of CRC table + */ + var makeCRCTable = function makeCRCTable() { + var crcTable = []; + var c; + + for (var n = 0; n < 256; n++) { + c = n; + + for (var k = 0; k < 8; k++) { + c = c & 1 ? 0xedb88320 ^ c >>> 1 : c >>> 1; + } + + crcTable[n] = c; + } + + return crcTable; + }; + /** + * + * @param {string} str + * @returns {Bystream} crc32 + */ + + + var crc32 = function crc32(str) { + var crcTable = makeCRCTable(); + var crc = 0 ^ -1; + + for (var i = 0; i < str.length; i++) { + crc = crc >>> 8 ^ crcTable[(crc ^ str.charCodeAt(i)) & 0xff]; + } + + return (crc ^ -1) >>> 0; + }; + + /** + * @description An interface to fetch user device details. + * @version v1.0.0 + */ + var USER_INTERFACE = { + /** + * @param {*} req + * @returns {string} user language + */ + getUserLanguage: function getUserLanguage() { + return navigator && navigator.language; + }, + + /** + * @param {*} req + * @returns {string} userAgent + */ + getUserAgent: function getUserAgent() { + return navigator && navigator.userAgent; + } + }; + + /** + * @description This is utility function for decoding from base 64 to utf8 + * @version v1.0.0 + */ + + /** + * @param {string} str base64 + * @returns {string} utf8 + */ + function b64DecodeUnicode(str) { + // Going backwards: from bytestream, to percent-encoding, to original string. + return decodeURIComponent(atob(str).split('').map(function (c) { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + } + /** + * @param {string} value + * @return {string} + */ + + + function decode$3() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + data = data.endsWith("..") ? data.substr(0, data.length - 2) : data; + return b64DecodeUnicode(data); + } + + /** + * @description AMP Linker Parser (works for Rudder, GA or any other linker created by following Google's linker standard.) + * @version v1.0.0 + * @author Parth Mahajan, Ayush Mehra + */ + var KEY_VALIDATOR = /^[a-zA-Z0-9\-_.]+$/; + var CHECKSUM_OFFSET_MAX_MIN = 1; + var VALID_VERSION = 1; + var DELIMITER = "*"; + /** + * Return the key value pairs + * @param {string} value + * @return {?Object} + */ + + function parseLinker(value) { + var linkerObj = parseLinkerParamValue(value); + + if (!linkerObj) { + return null; + } + + var checksum = linkerObj.checksum, + serializedIds = linkerObj.serializedIds; + + if (!isCheckSumValid(serializedIds, checksum)) { + return null; + } + + return deserialize(serializedIds); + } + /** + * Parse the linker param value to version checksum and serializedParams + * @param {string} value + * @return {?Object} + */ + + + function parseLinkerParamValue(value) { + var parts = value.split(DELIMITER); + var isEven = parts.length % 2 == 0; + + if (parts.length < 4 || !isEven) { + // Format *** + // Note: linker makes sure there's at least one pair of non empty key value + // Make sure there is at least three delimiters. + return null; + } + + var version = Number(parts.shift()); + + if (version !== VALID_VERSION) { + return null; + } + + var checksum = parts.shift(); + var serializedIds = parts.join(DELIMITER); + return { + checksum: checksum, + serializedIds: serializedIds + }; + } + /** + * Check if the checksum is valid with time offset tolerance. + * @param {string} serializedIds + * @param {string} checksum + * @return {boolean} + */ + + + function isCheckSumValid(serializedIds, checksum) { + var userAgent = USER_INTERFACE.getUserAgent(); + var language = USER_INTERFACE.getUserLanguage(); + + for (var i = 0; i <= CHECKSUM_OFFSET_MAX_MIN; i++) { + var calculateCheckSum = getCheckSum(serializedIds, i, userAgent, language); + + if (calculateCheckSum == checksum) { + return true; + } + } + + return false; + } + /** + * Deserialize the serializedIds and return keyValue pairs. + * @param {string} serializedIds + * @return {!Object} + */ + + + function deserialize(serializedIds) { + var keyValuePairs = {}; + var params = serializedIds.split(DELIMITER); + + for (var i = 0; i < params.length; i += 2) { + var key = params[i]; + var valid = KEY_VALIDATOR.test(key); + + if (!valid) { + continue; + } + + var value = decode$3(params[i + 1]); //const value = params[i + 1]; + + keyValuePairs[key] = value; + } + + return keyValuePairs; + } + /** + * Create a unique checksum hashing the fingerprint and a few other values. + * @param {string} serializedIds + * @param {number=} opt_offsetMin + * @return {string} + */ + + + function getCheckSum(serializedIds, opt_offsetMin, userAgent, language) { + var fingerprint = getFingerprint(userAgent, language); + var offset = opt_offsetMin || 0; + var timestamp = getMinSinceEpoch() - offset; + var crc = crc32([fingerprint, timestamp, serializedIds].join(DELIMITER)); // Encoded to base36 for less bytes. + + return crc.toString(36); + } + /** + * Generates a semi-unique value for page visitor. + * @return {string} + */ + + + function getFingerprint(userAgent, language) { + var date = new Date(); + var timezone = date.getTimezoneOffset(); + return [userAgent, timezone, language].join(DELIMITER); + } + /** + * Rounded time used to check if t2 - t1 is within our time tolerance. + * @return {number} + */ + + + function getMinSinceEpoch() { + // Timestamp in minutes, floored. + return Math.floor(Date.now() / 60000); + } + + var queryDefaults = { + trait: "ajs_trait_", + prop: "ajs_prop_" + }; // https://unpkg.com/test-rudder-sdk@1.0.5/dist/browser.js + + /** + * Add the rudderelement object to flush queue * * @param {RudderElement} rudderElement */ @@ -18482,9 +19053,7 @@ */ - var Analytics = - /*#__PURE__*/ - function () { + var Analytics = /*#__PURE__*/function () { /** * Creates an instance of Analytics. * @memberof Analytics @@ -18495,6 +19064,7 @@ this.autoTrackHandlersRegistered = false; this.autoTrackFeatureEnabled = false; this.initialized = false; + this.areEventsReplayed = false; this.trackValues = []; this.eventsBuffer = []; this.clientIntegrations = []; @@ -18517,6 +19087,7 @@ syncPixel: "syncPixelCallback" }; this.loaded = false; + this.loadIntegration = true; } /** * initialize the user after load config @@ -18561,7 +19132,7 @@ } response.source.destinations.forEach(function (destination, index) { - logger.debug("Destination ".concat(index, " Enabled? ").concat(destination.enabled, " Type: ").concat(destination.destinationDefinition.name, " Use Native SDK? ").concat(destination.config.useNativeSDK)); + logger.debug("Destination ".concat(index, " Enabled? ").concat(destination.enabled, " Type: ").concat(destination.destinationDefinition.name, " Use Native SDK? true")); if (destination.enabled) { this.clientIntegrations.push({ @@ -18584,7 +19155,7 @@ logger.debug("autoTrackHandlersRegistered", this.autoTrackHandlersRegistered); if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) { - addDomEventHandlers(); + addDomEventHandlers(this); this.autoTrackHandlersRegistered = true; } } @@ -18615,18 +19186,21 @@ return; } + var intgInstance; intgArray.forEach(function (intg) { try { logger.debug("[Analytics] init :: trying to initialize integration name:: ", intg.name); var intgClass = integrations[intg.name]; var destConfig = intg.config; - var intgInstance = new intgClass(destConfig, self); + intgInstance = new intgClass(destConfig, self); intgInstance.init(); logger.debug("initializing destination: ", intg); _this.isInitialized(intgInstance).then(_this.replayEvents); } catch (e) { logger.error("[Analytics] initialize integration (integration.init()) failed :: ", intg.name); + + _this.failedToBeLoadedIntegration.push(intgInstance); } }); } // eslint-disable-next-line class-methods-use-this @@ -18634,13 +19208,13 @@ }, { key: "replayEvents", value: function replayEvents(object) { - if (object.successfullyLoadedIntegration.length + object.failedToBeLoadedIntegration.length === object.clientIntegrations.length) { - logger.debug("===replay events called====", object.successfullyLoadedIntegration.length, object.failedToBeLoadedIntegration.length); // eslint-disable-next-line no-param-reassign + if (object.successfullyLoadedIntegration.length + object.failedToBeLoadedIntegration.length === object.clientIntegrations.length && !object.areEventsReplayed) { + logger.debug("===replay events called====", " successfully loaded count: ", object.successfullyLoadedIntegration.length, " failed loaded count: ", object.failedToBeLoadedIntegration.length); // eslint-disable-next-line no-param-reassign object.clientIntegrationObjects = []; // eslint-disable-next-line no-param-reassign object.clientIntegrationObjects = object.successfullyLoadedIntegration; - logger.debug("==registering after callback===", object.clientIntegrationObjects.length); + logger.debug("==registering after callback===", " after to be called after count : ", object.clientIntegrationObjects.length); object.executeReadyCallback = after_1(object.clientIntegrationObjects.length, object.readyCallback); logger.debug("==registering ready callback==="); object.on("ready", object.executeReadyCallback); @@ -18685,6 +19259,8 @@ }); object.toBeProcessedByIntegrationArray = []; } + + object.areEventsReplayed = true; } } }, { @@ -19015,7 +19591,9 @@ } this.processOptionsParam(rudderElement, options); - logger.debug(JSON.stringify(rudderElement)); // structure user supplied integrations object to rudder format + logger.debug(JSON.stringify(rudderElement)); // check for reserved keys and log + + checkReservedKeywords(rudderElement.message, type); // structure user supplied integrations object to rudder format if (Object.keys(rudderElement.message.integrations).length > 0) { tranformToRudderNames(rudderElement.message.integrations); @@ -19168,11 +19746,24 @@ return this.anonymousId; } + /** + * Sets anonymous id in the followin precedence: + * 1. anonymousId: Id directly provided to the function. + * 2. rudderAmpLinkerParm: value generated from linker query parm (rudderstack) + * using praseLinker util. + * 3. generateUUID: A new uniquie id is generated and assigned. + * + * @param {string} anonymousId + * @param {string} rudderAmpLinkerParm + */ + }, { key: "setAnonymousId", - value: function setAnonymousId(anonymousId) { + value: function setAnonymousId(anonymousId, rudderAmpLinkerParm) { // if (!this.loaded) return; - this.anonymousId = anonymousId || generateUUID(); + var parsedAnonymousIdObj = rudderAmpLinkerParm ? parseLinker(rudderAmpLinkerParm) : null; + var parsedAnonymousId = parsedAnonymousIdObj ? parsedAnonymousIdObj.rs_amp_id : null; + this.anonymousId = anonymousId || parsedAnonymousId || generateUUID(); this.storage.setAnonymousId(this.anonymousId); } }, { @@ -19259,6 +19850,10 @@ this.eventRepository.startQueue({}); } + if (options && options.loadIntegration != undefined) { + this.loadIntegration = !!options.loadIntegration; + } + this.eventRepository.writeKey = writeKey; if (serverUrl) { @@ -19276,7 +19871,7 @@ this.autoTrackFeatureEnabled = true; if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) { - addDomEventHandlers(); + addDomEventHandlers(this); this.autoTrackHandlersRegistered = true; logger.debug("autoTrackHandlersRegistered", this.autoTrackHandlersRegistered); } @@ -19288,9 +19883,11 @@ handleError(error); if (this.autoTrackFeatureEnabled && !this.autoTrackHandlersRegistered) { - addDomEventHandlers(); + addDomEventHandlers(this); } } + + processDataInAnalyticsArray(this); } }, { key: "ready", @@ -19408,19 +20005,34 @@ return Analytics; }(); - function pushDataToAnalyticsArray(argumentsArray, obj) { + function pushQueryStringDataToAnalyticsArray(obj) { if (obj.anonymousId) { if (obj.userId) { - argumentsArray.unshift(["setAnonymousId", obj.anonymousId], ["identify", obj.userId, obj.traits]); + instance.toBeProcessedArray.push(["setAnonymousId", obj.anonymousId], ["identify", obj.userId, obj.traits]); } else { - argumentsArray.unshift(["setAnonymousId", obj.anonymousId]); + instance.toBeProcessedArray.push(["setAnonymousId", obj.anonymousId]); } } else if (obj.userId) { - argumentsArray.unshift(["identify", obj.userId, obj.traits]); + instance.toBeProcessedArray.push(["identify", obj.userId, obj.traits]); } if (obj.event) { - argumentsArray.push(["track", obj.event, obj.properties]); + instance.toBeProcessedArray.push(["track", obj.event, obj.properties]); + } + } + + function processDataInAnalyticsArray(analytics) { + if (instance.loaded) { + for (var i = 0; i < analytics.toBeProcessedArray.length; i++) { + var event = _toConsumableArray(analytics.toBeProcessedArray[i]); + + var method = event[0]; + event.shift(); + logger.debug("=====from analytics array, calling method:: ", method); + analytics[method].apply(analytics, _toConsumableArray(event)); + } + + instance.toBeProcessedArray = []; } } @@ -19453,24 +20065,16 @@ var parsedQueryObject = instance.parseQueryString(window.location.search); - pushDataToAnalyticsArray(argumentsArray, parsedQueryObject); + pushQueryStringDataToAnalyticsArray(parsedQueryObject); - if (eventsPushedAlready && argumentsArray && argumentsArray.length > 0) { + if (argumentsArray && argumentsArray.length > 0) { for (var i$1 = 0; i$1 < argumentsArray.length; i$1++) { instance.toBeProcessedArray.push(argumentsArray[i$1]); } + } - for (var _i = 0; _i < instance.toBeProcessedArray.length; _i++) { - var event = _toConsumableArray(instance.toBeProcessedArray[_i]); - - var _method = event[0]; - event.shift(); - logger.debug("=====from init, calling method:: ", _method); - - instance[_method].apply(instance, _toConsumableArray(event)); - } - - instance.toBeProcessedArray = []; + if (eventsPushedAlready) { + processDataInAnalyticsArray(instance); } // } @@ -19500,4 +20104,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); -})); +}))); diff --git a/dist/rudder-sdk-js/package.json b/dist/rudder-sdk-js/package.json index 8271e5499..971a3bb43 100644 --- a/dist/rudder-sdk-js/package.json +++ b/dist/rudder-sdk-js/package.json @@ -1,6 +1,6 @@ { "name": "rudder-sdk-js", - "version": "1.0.14", + "version": "1.0.15", "description": "Rudder Javascript SDK", "main": "index.js", "types": "index.d.ts", diff --git a/integrations/Amplitude/browser.js b/integrations/Amplitude/browser.js index 6695e8ee6..fb86c338c 100644 --- a/integrations/Amplitude/browser.js +++ b/integrations/Amplitude/browser.js @@ -49,112 +49,114 @@ class Amplitude { } init() { - (function (e, t) { - const n = e.amplitude || { - _q: [], - _iq: {}, - }; - const r = t.createElement("script"); - r.type = "text/javascript"; - r.integrity = - "sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M"; - r.crossOrigin = "anonymous"; - r.async = true; - r.src = "https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js"; - r.onload = function () { - if (!e.amplitude.runQueuedFunctions) { - console.log("[Amplitude] Error: could not load SDK"); + if(this.analytics.loadIntegration){ + (function (e, t) { + const n = e.amplitude || { + _q: [], + _iq: {}, + }; + const r = t.createElement("script"); + r.type = "text/javascript"; + r.integrity = + "sha384-girahbTbYZ9tT03PWWj0mEVgyxtZoyDF9KVZdL+R53PP5wCY0PiVUKq0jeRlMx9M"; + r.crossOrigin = "anonymous"; + r.async = true; + r.src = "https://cdn.amplitude.com/libs/amplitude-7.2.1-min.gz.js"; + r.onload = function () { + if (!e.amplitude.runQueuedFunctions) { + console.log("[Amplitude] Error: could not load SDK"); + } + }; + const i = t.getElementsByTagName("script")[0]; + i.parentNode.insertBefore(r, i); + + function s(e, t) { + e.prototype[t] = function () { + this._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + return this; + }; } - }; - const i = t.getElementsByTagName("script")[0]; - i.parentNode.insertBefore(r, i); - - function s(e, t) { - e.prototype[t] = function () { - this._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + const o = function () { + this._q = []; return this; }; - } - const o = function () { - this._q = []; - return this; - }; - const a = [ - "add", - "append", - "clearAll", - "prepend", - "set", - "setOnce", - "unset", - ]; - for (let c = 0; c < a.length; c++) { - s(o, a[c]); - } - n.Identify = o; - const u = function () { - this._q = []; - return this; - }; - const l = [ - "setProductId", - "setQuantity", - "setPrice", - "setRevenueType", - "setEventProperties", - ]; - for (let p = 0; p < l.length; p++) { - s(u, l[p]); - } - n.Revenue = u; - const d = [ - "init", - "logEvent", - "logRevenue", - "setUserId", - "setUserProperties", - "setOptOut", - "setVersionName", - "setDomain", - "setDeviceId", - "enableTracking", - "setGlobalUserProperties", - "identify", - "clearUserProperties", - "setGroup", - "logRevenueV2", - "regenerateDeviceId", - "groupIdentify", - "onInit", - "logEventWithTimestamp", - "logEventWithGroups", - "setSessionId", - "resetSessionId", - ]; - - function v(e) { - function t(t) { - e[t] = function () { - e._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); - }; + const a = [ + "add", + "append", + "clearAll", + "prepend", + "set", + "setOnce", + "unset", + ]; + for (let c = 0; c < a.length; c++) { + s(o, a[c]); } - for (let n = 0; n < d.length; n++) { - t(d[n]); + n.Identify = o; + const u = function () { + this._q = []; + return this; + }; + const l = [ + "setProductId", + "setQuantity", + "setPrice", + "setRevenueType", + "setEventProperties", + ]; + for (let p = 0; p < l.length; p++) { + s(u, l[p]); } - } - v(n); - n.getInstance = function (e) { - e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase(); - if (!n._iq.hasOwnProperty(e)) { - n._iq[e] = { - _q: [], - }; - v(n._iq[e]); + n.Revenue = u; + const d = [ + "init", + "logEvent", + "logRevenue", + "setUserId", + "setUserProperties", + "setOptOut", + "setVersionName", + "setDomain", + "setDeviceId", + "enableTracking", + "setGlobalUserProperties", + "identify", + "clearUserProperties", + "setGroup", + "logRevenueV2", + "regenerateDeviceId", + "groupIdentify", + "onInit", + "logEventWithTimestamp", + "logEventWithGroups", + "setSessionId", + "resetSessionId", + ]; + + function v(e) { + function t(t) { + e[t] = function () { + e._q.push([t].concat(Array.prototype.slice.call(arguments, 0))); + }; + } + for (let n = 0; n < d.length; n++) { + t(d[n]); + } } - return n._iq[e]; - }; - e.amplitude = n; - })(window, document); + v(n); + n.getInstance = function (e) { + e = (!e || e.length === 0 ? "$default_instance" : e).toLowerCase(); + if (!n._iq.hasOwnProperty(e)) { + n._iq[e] = { + _q: [], + }; + v(n._iq[e]); + } + return n._iq[e]; + }; + e.amplitude = n; + })(window, document); + } const initOptions = { includeUtm: this.trackUtmProperties, diff --git a/integrations/GA/browser.js b/integrations/GA/browser.js index 4d14b3c35..10b1df71a 100644 --- a/integrations/GA/browser.js +++ b/integrations/GA/browser.js @@ -6,7 +6,8 @@ import { rejectArr } from "../../utils/utils"; import ScriptLoader from "../ScriptLoader"; export default class GA { - constructor(config) { + constructor(config, analytics) { + this.analytics = analytics; this.trackingID = config.trackingID; this.sendUserId = config.sendUserId || false; this.dimensions = config.dimensions || []; @@ -36,10 +37,21 @@ export default class GA { "product clicked", "product added", "product viewed", - "product removed", + "product removed" ]; } + initializeGlobalObject() { + window.GoogleAnalyticsObject = "ga"; + window.ga = + window.ga || + function a() { + window.ga.q = window.ga.q || []; + window.ga.q.push(arguments); + }; + window.ga.l = new Date().getTime(); + } + loadScript() { ScriptLoader( "google-analytics", @@ -51,7 +63,7 @@ export default class GA { this.pageCalled = false; this.dimensionsArray = {}; let elementTo; - this.dimensions.forEach((element) => { + this.dimensions.forEach(element => { if (element.to.startsWith("dimension")) { this.dimensionsArray[element.from] = element.to; } else { @@ -61,7 +73,7 @@ export default class GA { } }); this.metricsArray = {}; - this.metrics.forEach((element) => { + this.metrics.forEach(element => { if (element.to.startsWith("dimension")) { this.metricsArray[element.from] = element.to; } else { @@ -70,19 +82,14 @@ export default class GA { } }); this.contentGroupingsArray = {}; - this.contentGroupings.forEach((element) => { + this.contentGroupings.forEach(element => { this.contentGroupingsArray[element.from] = element.to; }); - window.GoogleAnalyticsObject = "ga"; - window.ga = - window.ga || - function a() { - window.ga.q = window.ga.q || []; - window.ga.q.push(arguments); - }; - window.ga.l = new Date().getTime(); - this.loadScript(); + if (this.analytics.loadIntegration) { + this.initializeGlobalObject(); + this.loadScript(); + } // create ga with these properties. if the properties are empty it will take default values. const config = { @@ -90,7 +97,7 @@ export default class GA { siteSpeedSampleRate: this.siteSpeedSampleRate, sampleRate: this.sampleRate, allowLinker: true, - useAmpClientId: this.useGoogleAmpClientId, + useAmpClientId: this.useGoogleAmpClientId }; // set tracker name to rudderGATracker if on @@ -102,24 +109,26 @@ export default class GA { } window.ga("create", this.trackingID, config); - if (this.optimizeContainerId) { - window.ga(`${this.trackerName}require`, this.optimizeContainerId); - } + if (this.analytics.loadIntegration) { + if (this.optimizeContainerId) { + window.ga(`${this.trackerName}require`, this.optimizeContainerId); + } - // ecommerce is required - if (!this.ecommerce) { - window.ga(`${this.trackerName}require`, "ecommerce"); - this.ecommerce = true; - } + // ecommerce is required + if (!this.ecommerce) { + window.ga(`${this.trackerName}require`, "ecommerce"); + this.ecommerce = true; + } - // this is to display advertising - if (this.doubleClick) { - window.ga(`${this.trackerName}require`, "displayfeatures"); - } + // this is to display advertising + if (this.doubleClick) { + window.ga(`${this.trackerName}require`, "displayfeatures"); + } - // https://support.google.com/analytics/answer/2558867?hl=en - if (this.enhancedLinkAttribution) { - window.ga(`${this.trackerName}require`, "linkid"); + // https://support.google.com/analytics/answer/2558867?hl=en + if (this.enhancedLinkAttribution) { + window.ga(`${this.trackerName}require`, "linkid"); + } } // a warning is in ga debugger if anonymize is false after initialization @@ -188,11 +197,11 @@ export default class GA { revenue: total, tax: properties.tax, id: orderId, - currency: properties.currency, + currency: properties.currency }); // products added - products.forEach((product) => { + products.forEach(product => { const productTrack = self.createProductTrack(rudderElement, product); window.ga(`${this.trackerName}ecommerce:addItem`, { @@ -202,7 +211,7 @@ export default class GA { name: productTrack.properties.name, sku: productTrack.properties.sku, id: orderId, - currency: productTrack.properties.currency, + currency: productTrack.properties.currency }); }); @@ -216,7 +225,7 @@ export default class GA { case "Checkout Step Viewed": case "Order Updated": this.loadEnhancedEcommerce(rudderElement); - each(products, (product) => { + each(products, product => { let productTrack = self.createProductTrack(rudderElement, product); productTrack = { message: productTrack }; @@ -225,7 +234,7 @@ export default class GA { window.ga(`${this.trackerName}ec:setAction`, "checkout", { step: properties.step || 1, - option: options || undefined, + option: options || undefined }); this.pushEnhancedEcommerce(rudderElement); @@ -237,7 +246,7 @@ export default class GA { } params = { step: props.step || 1, - option: options || undefined, + option: options || undefined }; this.loadEnhancedEcommerce(rudderElement); @@ -261,7 +270,7 @@ export default class GA { } this.loadEnhancedEcommerce(rudderElement); - each(products, (product) => { + each(products, product => { let productTrack = self.createProductTrack(rudderElement, product); productTrack = { message: productTrack }; self.enhancedEcommerceTrackProduct(productTrack); @@ -272,7 +281,7 @@ export default class GA { revenue: total, tax: props.tax, shipping: props.shipping, - coupon: props.coupon, + coupon: props.coupon }); this.pushEnhancedEcommerce(rudderElement); @@ -284,19 +293,19 @@ export default class GA { } this.loadEnhancedEcommerce(rudderElement); - each(products, (product) => { + each(products, product => { const track = { properties: product }; window.ga(`${this.trackerName}ec:addProduct`, { id: track.properties.product_id || track.properties.id || track.properties.sku, - quantity: track.properties.quantity, + quantity: track.properties.quantity }); }); window.ga(`${this.trackerName}ec:setAction`, "refund", { - id: orderId, + id: orderId }); this.pushEnhancedEcommerce(rudderElement); @@ -343,7 +352,7 @@ export default class GA { id: props.promotion_id || props.id, name: props.name, creative: props.creative, - position: props.position, + position: props.position }); this.pushEnhancedEcommerce(rudderElement); break; @@ -354,7 +363,7 @@ export default class GA { id: props.promotion_id || props.id, name: props.name, creative: props.creative, - position: props.position, + position: props.position }); window.ga(`${this.trackerName}ec:setAction`, "promo_click", {}); this.pushEnhancedEcommerce(rudderElement); @@ -362,7 +371,7 @@ export default class GA { case "Product List Viewed": this.loadEnhancedEcommerce(rudderElement); - each(products, (product) => { + each(products, product => { const item = { properties: product }; if ( !(item.properties.product_id || item.properties.sku) && @@ -381,7 +390,7 @@ export default class GA { brand: item.properties.band, variant: item.properties.variant, price: item.properties.price, - position: self.getProductPosition(item, products), + position: self.getProductPosition(item, products) }; impressionObj = { ...impressionObj, @@ -390,9 +399,9 @@ export default class GA { self.dimensionsArray, self.metricsArray, self.contentGroupingsArray - ), + ) }; - Object.keys(impressionObj).forEach((key) => { + Object.keys(impressionObj).forEach(key => { if (impressionObj[key] === undefined) delete impressionObj[key]; }); window.ga(`${this.trackerName}ec:addImpression`, impressionObj); @@ -403,19 +412,19 @@ export default class GA { props.filters = props.filters || []; props.sorts = props.sorts || []; filters = props.filters - .map((obj) => { + .map(obj => { return `${obj.type}:${obj.value}`; }) .join(); sorts = props.sorters - .map((obj) => { + .map(obj => { return `${obj.type}:${obj.value}`; }) .join(); this.loadEnhancedEcommerce(rudderElement); - each(products, (product) => { + each(products, product => { const item = { properties: product }; if ( @@ -436,7 +445,7 @@ export default class GA { brand: props.brand, variant: `${filters}::${sorts}`, price: item.price, - position: self.getProductPosition(item, products), + position: self.getProductPosition(item, products) }; impressionObj = { @@ -446,9 +455,9 @@ export default class GA { self.dimensionsArray, self.metricsArray, self.contentGroupingsArray - ), + ) }; - Object.keys(impressionObj).forEach((key) => { + Object.keys(impressionObj).forEach(key => { if (impressionObj[key] === undefined) delete impressionObj[key]; }); window.ga(`${this.trackerName}ec:addImpression`, impressionObj); @@ -471,7 +480,7 @@ export default class GA { nonInteraction: rudderElement.message.properties.nonInteraction !== undefined ? !!rudderElement.message.properties.nonInteraction - : !!this.nonInteraction, + : !!this.nonInteraction }; if (campaign) { @@ -486,7 +495,7 @@ export default class GA { payload, ...this.setCustomDimenionsAndMetrics( rudderElement.message.properties - ), + ) }; window.ga(`${this.trackerName}send`, "event", payload.payload); @@ -508,7 +517,7 @@ export default class GA { nonInteraction: rudderElement.message.properties.nonInteraction !== undefined ? !!rudderElement.message.properties.nonInteraction - : !!this.nonInteraction, + : !!this.nonInteraction }; if (campaign) { @@ -521,7 +530,7 @@ export default class GA { payload = { payload, - ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties), + ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties) }; window.ga(`${this.trackerName}send`, "event", payload.payload); @@ -591,14 +600,14 @@ export default class GA { // adds more properties to pageview which will be sent pageview = { ...pageview, - ...this.setCustomDimenionsAndMetrics(eventProperties), + ...this.setCustomDimenionsAndMetrics(eventProperties) }; const payload = { page: pagePath, - title: pageTitle, + title: pageTitle }; - logger.debug(pageReferrer); - logger.debug(document.referrer); + logger.debug("referrer: " + pageReferrer); + logger.debug("document referrer: ", document.referrer); if (pageReferrer !== document.referrer) payload.referrer = pageReferrer; window.ga(`${this.trackerName}set`, payload); @@ -650,7 +659,7 @@ export default class GA { metricsFunction(obj, dimensions, metrics, contentGroupings) { const ret = {}; - each([metrics, dimensions, contentGroupings], (group) => { + each([metrics, dimensions, contentGroupings], group => { each(group, (prop, key) => { let value = obj[prop]; if (is.boolean(value)) value = value.toString(); @@ -682,7 +691,7 @@ export default class GA { if (this.setAllMappedProps) { window.ga(`${this.trackerName}set`, custom); } else { - Object.keys(custom).forEach((key) => { + Object.keys(custom).forEach(key => { ret[key] = custom[key]; }); // each(custom, (key, value) => { @@ -755,7 +764,7 @@ export default class GA { price: props.price, brand: props.brand, variant: props.variant, - currency: props.currency, + currency: props.currency }; if (props.position != null) { @@ -771,7 +780,7 @@ export default class GA { this.dimensionsArray, this.metricsArray, this.contentGroupingsArray - ), + ) }; window.ga(`${this.trackerName}ec:addProduct`, product); @@ -802,8 +811,8 @@ export default class GA { rudderElement.message.properties.label, { nonInteraction: 1, - ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties), - }, + ...this.setCustomDimenionsAndMetrics(rudderElement.message.properties) + } ]); let { event } = rudderElement.message; @@ -833,7 +842,7 @@ export default class GA { return ( products - .map((x) => { + .map(x => { return x.product_id; }) .indexOf(item.properties.product_id) + 1 @@ -847,10 +856,10 @@ export default class GA { extractCheckoutOptions(rudderElement) { const options = [ rudderElement.message.properties.paymentMethod, - rudderElement.message.properties.shippingMethod, + rudderElement.message.properties.shippingMethod ]; // remove all nulls and join with commas. const valid = rejectArr(options); return valid.length > 0 ? valid.join(", ") : null; } -} \ No newline at end of file +} diff --git a/integrations/GA/index.test.js b/integrations/GA/index.test.js index a98957150..392185b13 100644 --- a/integrations/GA/index.test.js +++ b/integrations/GA/index.test.js @@ -12,7 +12,7 @@ GA.prototype.loadScript = jest.fn(); describe("GA init tests", () => { let googleAnalytics; beforeEach(() => { - googleAnalytics = new GA({ trackingID: "UA-143161493-8" }); + googleAnalytics = new GA({ trackingID: "UA-143161493-8" }, {loadIntegration: true}); googleAnalytics.init(); }); @@ -58,7 +58,7 @@ describe("GA init tests", () => { "resetCustomDimensionsOnPage": "testDimension" } ] - }); + }, {loadIntegration: true}); googleAnalytics.init(); window.ga = jest.fn(); }); @@ -104,7 +104,7 @@ describe("GA init tests", () => { dimensions: [], metrics: [], contentGroupings: [], - }); + }, {loadIntegration: true}); googleAnalytics.init(); window.ga = jest.fn(); }); diff --git a/integrations/Posthog/browser.js b/integrations/Posthog/browser.js new file mode 100644 index 000000000..25e2aee31 --- /dev/null +++ b/integrations/Posthog/browser.js @@ -0,0 +1,141 @@ +/* eslint-disable class-methods-use-this */ +import logger from "../../utils/logUtil"; + +class Posthog { + constructor(config, analytics) { + this.name = "POSTHOG"; + this.analytics = analytics; + this.teamApiKey = config.teamApiKey; + this.yourInstance = config.yourInstance || "https://app.posthog.com"; + this.autocapture = config.autocapture || false; + this.capturePageView = config.capturePageView || false; + this.disableSessionRecording = config.disableSessionRecording || false; + this.disableCookie = config.disableCookie || false; + this.propertyBlackList = []; + this.xhrHeaders = {}; + + if (config.xhrHeaders && config.xhrHeaders.length > 0) { + config.xhrHeaders.forEach(header => { + if(header && header.key && header.value && header.key.trim() != "" && header.value.trim() != ""){ + this.xhrHeaders[header.key] = header.value; + } + }); + } + if (config.propertyBlackList && config.propertyBlackList.length > 0) { + config.propertyBlackList.forEach(element => { + if(element && element.property && element.property.trim() != ""){ + this.propertyBlackList.push(element.property); + } + }); + } + } + + init() { + ! function (t, e) { + var o, n, p, r; + e.__SV || (window.posthog = e, e._i = [], e.init = function (i, s, a) { + function g(t, e) { + var o = e.split("."); + 2 == o.length && (t = t[o[0]], e = o[1]), t[e] = function () { + t.push([e].concat(Array.prototype.slice.call(arguments, 0))) + } + }(p = t.createElement("script")).type = "text/javascript", p.async = !0, p.src = s.api_host + "/static/array.js", (r = t.getElementsByTagName("script")[0]).parentNode.insertBefore(p, r); + var u = e; + for (void 0 !== a ? u = e[a] = [] : a = "posthog", u.people = u.people || [], u.toString = function (t) { + var e = "posthog"; + return "posthog" !== a && (e += "." + a), t || (e += " (stub)"), e + }, u.people.toString = function () { + return u.toString(1) + ".people (stub)" + }, o = "capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags".split(" "), n = 0; n < o.length; n++) g(u, o[n]); + e._i.push([i, s, a]) + }, e.__SV = 1) + }(document, window.posthog || []); + + const configObject = {api_host: this.yourInstance, + autocapture: this.autocapture, + capture_pageview: this.capturePageView, + disable_session_recording: this.disableSessionRecording, + property_blacklist: this.propertyBlackList, + disable_cookie: this.disableCookie + }; + if(this.xhrHeaders && Object.keys(this.xhrHeaders).length > 0){ + configObject.xhr_headers = this.xhrHeaders; + } + + posthog.init(this.teamApiKey, configObject); + } + + /** + * superproperties should be part of rudderelement.message.integrations.POSTHOG object. + * Once we call the posthog.register api, the corresponding property will be sent along with subsequent capture calls. + * To remove the superproperties, we call unregister api. + */ + processSuperProperties(rudderElement){ + const integrations = rudderElement.message.integrations; + if(integrations && integrations.POSTHOG){ + const {superProperties, setOnceProperties, unsetProperties} = integrations.POSTHOG; + if(superProperties && Object.keys(superProperties).length > 0){ + posthog.register(superProperties); + } + if(setOnceProperties && Object.keys(setOnceProperties).length > 0){ + posthog.register_once(setOnceProperties); + } + if(unsetProperties && unsetProperties.length > 0){ + unsetProperties.forEach(property => { + if(property && property.trim() != ""){ + posthog.unregister(property); + } + }); + } + } + + } + + identify(rudderElement) { + logger.debug("in Posthog identify"); + + // rudderElement.message.context will always be present as part of identify event payload. + const { traits } = rudderElement.message.context; + const { userId } = rudderElement.message; + + if (userId) { + posthog.identify(userId, traits); + } + + this.processSuperProperties(rudderElement); + } + + track(rudderElement) { + logger.debug("in Posthog track"); + + const { event, properties } = rudderElement.message; + + this.processSuperProperties(rudderElement); + + posthog.capture(event, properties); + } + + /** + * + * + * @memberof Posthog + */ + page(rudderElement) { + logger.debug("in Posthog page"); + + this.processSuperProperties(rudderElement); + + posthog.capture('$pageview'); + } + + isLoaded() { + logger.debug("in Posthog isLoaded"); + return !!(window.posthog && window.posthog.__loaded); + } + + isReady() { + return !!(window.posthog && window.posthog.__loaded); + } +} + +export default Posthog; diff --git a/integrations/Posthog/index.js b/integrations/Posthog/index.js new file mode 100644 index 000000000..4939def21 --- /dev/null +++ b/integrations/Posthog/index.js @@ -0,0 +1,3 @@ +import Posthog from "./browser"; + +export default Posthog; diff --git a/integrations/Posthog/test/test_posthog.html b/integrations/Posthog/test/test_posthog.html new file mode 100644 index 000000000..c7a35fa7c --- /dev/null +++ b/integrations/Posthog/test/test_posthog.html @@ -0,0 +1,54 @@ + + + + + + + +

Relax while I finish my testing process....

+ + \ No newline at end of file diff --git a/integrations/ScriptLoader.js b/integrations/ScriptLoader.js index 7c3ce3221..69b54e323 100644 --- a/integrations/ScriptLoader.js +++ b/integrations/ScriptLoader.js @@ -8,7 +8,8 @@ const ScriptLoader = (id, src) => { js.type = "text/javascript"; js.id = id; const e = document.getElementsByTagName("script")[0]; - logger.debug("==script==", e); + logger.debug("==parent script==", e); + logger.debug("==adding script==", js); e.parentNode.insertBefore(js, e); }; diff --git a/integrations/client_server_name.js b/integrations/client_server_name.js index 173f1b247..3ff84b09e 100644 --- a/integrations/client_server_name.js +++ b/integrations/client_server_name.js @@ -26,6 +26,7 @@ const clientToServerNames = { PENDO: "Pendo", LYTICS: "Lytics", APPCUES: "Appcues", + POSTHOG: "PostHog" }; export { clientToServerNames }; diff --git a/integrations/index.js b/integrations/index.js index 5abfd8e3d..7c7bb1211 100644 --- a/integrations/index.js +++ b/integrations/index.js @@ -23,6 +23,7 @@ import * as Amplitude from "./Amplitude"; import * as Pendo from "./Pendo"; import * as Lytics from "./Lytics"; import * as Appcues from "./Appcues"; +import * as Posthog from "./Posthog"; // the key names should match the destination.name value to keep partity everywhere // (config-plan name, native destination.name , exported integration name(this one below)) @@ -53,6 +54,7 @@ const integrations = { PENDO: Pendo.default, LYTICS: Lytics.default, APPCUES: Appcues.default, + POSTHOG: Posthog.default }; export { integrations }; diff --git a/integrations/integration_cname.js b/integrations/integration_cname.js index 45766d81d..610715358 100644 --- a/integrations/integration_cname.js +++ b/integrations/integration_cname.js @@ -56,6 +56,9 @@ const commonNames = { LYTICS: "Lytics", Appcues: "APPCUES", APPCUES: "APPCUES", + POSTHOG: "POSTHOG", + PostHog: "POSTHOG", + Posthog: "POSTHOG" }; export { commonNames }; diff --git a/stats.html b/stats.html index b2fe9eee1..f70a3355c 100644 --- a/stats.html +++ b/stats.html @@ -2648,7 +2648,7 @@