@rudderstack/analytics-js 3.33.0 → 3.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +2 -2
- package/dist/npm/index.d.cts +8 -0
- package/dist/npm/index.d.mts +8 -0
- package/dist/npm/legacy/bundled/cjs/index.cjs +109 -52
- package/dist/npm/legacy/bundled/esm/index.mjs +109 -52
- package/dist/npm/legacy/bundled/umd/index.js +109 -52
- package/dist/npm/legacy/cjs/index.cjs +109 -52
- package/dist/npm/legacy/content-script/cjs/index.cjs +109 -52
- package/dist/npm/legacy/content-script/esm/index.mjs +109 -52
- package/dist/npm/legacy/content-script/umd/index.js +109 -52
- package/dist/npm/legacy/esm/index.mjs +109 -52
- package/dist/npm/legacy/lite/cjs/index.cjs +85 -32
- package/dist/npm/legacy/lite/esm/index.mjs +85 -32
- package/dist/npm/legacy/lite/umd/index.js +85 -32
- package/dist/npm/legacy/umd/index.js +109 -52
- package/dist/npm/modern/bundled/cjs/index.cjs +107 -50
- package/dist/npm/modern/bundled/esm/index.mjs +107 -50
- package/dist/npm/modern/bundled/umd/index.js +107 -50
- package/dist/npm/modern/cjs/index.cjs +64 -23
- package/dist/npm/modern/content-script/cjs/index.cjs +107 -50
- package/dist/npm/modern/content-script/esm/index.mjs +107 -50
- package/dist/npm/modern/content-script/umd/index.js +107 -50
- package/dist/npm/modern/esm/index.mjs +64 -23
- package/dist/npm/modern/lite/cjs/index.cjs +83 -30
- package/dist/npm/modern/lite/esm/index.mjs +83 -30
- package/dist/npm/modern/lite/umd/index.js +83 -30
- package/dist/npm/modern/umd/index.js +64 -23
- package/package.json +1 -1
|
@@ -913,7 +913,7 @@ Object.getOwnPropertyNames(err).forEach(function(key){if(key!=='message'&&key!==
|
|
|
913
913
|
}}});return newError;}catch(_unused2){return new Error("".concat(issue,": ").concat(stringifyWithoutCircular(err)));}};var dispatchErrorEvent=function dispatchErrorEvent(error){if(isTypeOfError(error)){var errStack=getStacktrace(error);if(errStack){// eslint-disable-next-line no-param-reassign
|
|
914
914
|
error.stack="".concat(errStack,"\n").concat(MANUAL_ERROR_IDENTIFIER);}}globalThis.dispatchEvent(new ErrorEvent('error',{error:error,bubbles:true,cancelable:true,composed:true}));};
|
|
915
915
|
|
|
916
|
-
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.
|
|
916
|
+
var APP_NAME='RudderLabs JavaScript SDK';var APP_VERSION='3.34.0';var APP_NAMESPACE='com.rudderlabs.javascript';var MODULE_TYPE='npm';var BUILD_VARIANT='legacy';var ADBLOCK_PAGE_CATEGORY='RudderJS-Initiated';var ADBLOCK_PAGE_NAME='ad-block page request';var ADBLOCK_PAGE_PATH='/ad-blocked';var GLOBAL_PRELOAD_BUFFER='preloadedEventsBuffer';var CONSENT_TRACK_EVENT_NAME='Consent Management Interaction';
|
|
917
917
|
|
|
918
918
|
var QUERY_PARAM_TRAIT_PREFIX='ajs_trait_';var QUERY_PARAM_PROPERTY_PREFIX='ajs_prop_';var QUERY_PARAM_ANONYMOUS_ID_KEY='ajs_aid';var QUERY_PARAM_USER_ID_KEY='ajs_uid';var QUERY_PARAM_TRACK_EVENT_NAME_KEY='ajs_event';
|
|
919
919
|
|
|
@@ -1032,8 +1032,8 @@ var ErrorType=/*#__PURE__*/function(ErrorType){ErrorType["HANDLEDEXCEPTION"]="ha
|
|
|
1032
1032
|
var SUPPORTED_STORAGE_TYPES=['localStorage','memoryStorage','cookieStorage','sessionStorage','none'];var DEFAULT_STORAGE_TYPE='cookieStorage';
|
|
1033
1033
|
|
|
1034
1034
|
var SOURCE_CONFIG_RESOLUTION_ERROR="Unable to process/parse source configuration response";var SOURCE_DISABLED_ERROR="The source is disabled. Please enable the source in the dashboard to send events.";var XHR_PAYLOAD_PREP_ERROR="Failed to prepare data for the request.";var PLUGIN_EXT_POINT_MISSING_ERROR="Failed to invoke plugin because the extension point name is missing.";var PLUGIN_EXT_POINT_INVALID_ERROR="Failed to invoke plugin because the extension point name is invalid.";var SOURCE_CONFIG_OPTION_ERROR=function SOURCE_CONFIG_OPTION_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"getSourceConfig\" load API option must be a function that returns valid source configuration data.");};var COMPONENT_BASE_URL_ERROR=function COMPONENT_BASE_URL_ERROR(context,component,url){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The base URL \"").concat(url,"\" for ").concat(component," is not valid.");};// ERROR
|
|
1035
|
-
var UNSUPPORTED_CONSENT_MANAGER_ERROR=function UNSUPPORTED_CONSENT_MANAGER_ERROR(context,selectedConsentManager,consentManagersToPluginNameMap){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The consent manager \"").concat(selectedConsentManager,"\" is not supported. Please choose one of the following supported consent managers: \"").concat(Object.keys(consentManagersToPluginNameMap),"\".");};var NON_ERROR_WARNING=function NON_ERROR_WARNING(context,errStr){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring a non-error: ").concat(errStr,".");};var BREADCRUMB_ERROR="Failed to log breadcrumb";var HANDLE_ERROR_FAILURE=function HANDLE_ERROR_FAILURE(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to handle the error.");};var PLUGIN_NAME_MISSING_ERROR=function PLUGIN_NAME_MISSING_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin name is missing.");};var PLUGIN_ALREADY_EXISTS_ERROR=function PLUGIN_ALREADY_EXISTS_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" already exists.");};var PLUGIN_NOT_FOUND_ERROR=function PLUGIN_NOT_FOUND_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found.");};var PLUGIN_ENGINE_BUG_ERROR=function PLUGIN_ENGINE_BUG_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found in plugins but found in byName. This indicates a bug in the plugin engine. Please report this issue to the development team.");};var PLUGIN_DEPS_ERROR=function PLUGIN_DEPS_ERROR(context,pluginName,notExistDeps){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" could not be loaded because some of its dependencies \"").concat(notExistDeps,"\" do not exist.");};var PLUGIN_INVOCATION_ERROR=function PLUGIN_INVOCATION_ERROR(context,extPoint,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to invoke the \"").concat(extPoint,"\" extension point of plugin \"").concat(pluginName,"\".");};var SOURCE_CONFIG_FETCH_ERROR='Failed to fetch the source config';var WRITE_KEY_VALIDATION_ERROR=function WRITE_KEY_VALIDATION_ERROR(context,writeKey){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The write key \"").concat(writeKey,"\" is invalid. It must be a non-empty string. Please check that the write key is correct and try again.");};var DATA_PLANE_URL_VALIDATION_ERROR=function DATA_PLANE_URL_VALIDATION_ERROR(context,dataPlaneUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The data plane URL \"").concat(dataPlaneUrl,"\" is invalid. It must be a valid URL string. Please check that the data plane URL is correct and try again.");};var INVALID_CALLBACK_FN_ERROR=function INVALID_CALLBACK_FN_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided callback parameter is not a function.");};var XHR_DELIVERY_ERROR=function XHR_DELIVERY_ERROR(prefix,status,statusText,url,response){return "".concat(prefix," with status ").concat(status," (").concat(statusText,") for URL: ").concat(url,". Response: ").concat(response.trim());};var XHR_REQUEST_ERROR=function XHR_REQUEST_ERROR(prefix,e,url){return "".concat(prefix," due to timeout or no connection (").concat(e?e.type:'',") at the client side for URL: ").concat(url);};var XHR_SEND_ERROR=function XHR_SEND_ERROR(prefix,url){return "".concat(prefix," for URL: ").concat(url);};var STORE_DATA_SAVE_ERROR=function STORE_DATA_SAVE_ERROR(key){return "Failed to save the value for \"".concat(key,"\" to storage");};var STORE_DATA_FETCH_ERROR=function STORE_DATA_FETCH_ERROR(key){return "Failed to retrieve or parse data for \"".concat(key,"\" from storage");};var DATA_SERVER_REQUEST_FAIL_ERROR=function DATA_SERVER_REQUEST_FAIL_ERROR(status){return "The server responded with status ".concat(status," while setting the cookies. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_ERROR=function FAILED_SETTING_COOKIE_FROM_SERVER_ERROR(key){return "The server failed to set the ".concat(key," cookie. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_GLOBAL_ERROR="Failed to set/remove cookies via server. As a fallback, the cookies will be managed client side.";var COLLAPSED_COOKIE_BATCH_ERROR=function COLLAPSED_COOKIE_BATCH_ERROR(missingCookies,batchSize){return "The server did not set ".concat(missingCookies.length," of the ").concat(batchSize," cookies sent in one request: ").concat(missingCookies.join(', '),". A fallback to set them client side was attempted. Check that the data service and any proxy preserve every \"Set-Cookie\" header, and that the cookie domain and SameSite/Secure attributes are valid.");};// WARNING
|
|
1036
|
-
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING=function UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entry,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" configured for the entry \"").concat(entry,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING=function UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(context,selectedStorageEncryptionVersion,storageEncryptionVersionsToPluginNameMap,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage encryption version \"").concat(selectedStorageEncryptionVersion,"\" is not supported. Please choose one of the following supported versions: \"").concat(Object.keys(storageEncryptionVersionsToPluginNameMap),"\". The default version \"").concat(defaultVersion,"\" will be used instead.");};var STORAGE_DATA_MIGRATION_OVERRIDE_WARNING=function STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(context,storageEncryptionVersion,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage data migration has been disabled because the configured storage encryption version (").concat(storageEncryptionVersion,") is not the latest (").concat(defaultVersion,"). To enable storage data migration, please update the storage encryption version to the latest version.");};var SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(context,providedCookieDomain,currentCookieDomain){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided cookie domain (").concat(providedCookieDomain,") does not match the current webpage's domain (").concat(currentCookieDomain,"). Hence, the cookies will be set client-side.");};var RESERVED_KEYWORD_WARNING=function RESERVED_KEYWORD_WARNING(context,property,parentKeyPath,reservedElements){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"").concat(property,"\" property defined under \"").concat(parentKeyPath,"\" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (").concat(reservedElements,").");};var RESERVED_CUSTOM_CONTEXT_KEY_WARNING=function RESERVED_CUSTOM_CONTEXT_KEY_WARNING(logContext,property){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"The top-level custom context property \"").concat(property,"\" is reserved and was ignored.");};var INVALID_CONTEXT_OBJECT_WARNING=function INVALID_CONTEXT_OBJECT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.");};var INVALID_CUSTOM_CONTEXT_WARNING=function INVALID_CUSTOM_CONTEXT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Invalid custom context. Use a plain object without prototype pollution keys.");};var UNSUPPORTED_BEACON_API_WARNING=function UNSUPPORTED_BEACON_API_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The Beacon API is not supported by your browser. The events will be sent using XHR instead.");};var TIMEOUT_NOT_NUMBER_WARNING=function TIMEOUT_NOT_NUMBER_WARNING(context,timeout,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value \"").concat(timeout,"\" is not a number. The default timeout of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_NOT_NUMBER_WARNING=function CUT_OFF_DURATION_NOT_NUMBER_WARNING(context,cutOffDuration,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" is not a number. The default cut off duration of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING=function CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING(context,cutOffDuration,timeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" ms is less than the session timeout value \"").concat(timeout,"\" ms. The cut off functionality will be disabled.");};var TIMEOUT_ZERO_WARNING=function TIMEOUT_ZERO_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.");};var TIMEOUT_NOT_RECOMMENDED_WARNING=function TIMEOUT_NOT_RECOMMENDED_WARNING(context,timeout,minTimeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value ").concat(timeout," ms is less than the recommended minimum of ").concat(minTimeout," ms. Please consider increasing the timeout value to ensure optimal performance and reliability.");};var INVALID_SESSION_ID_WARNING=function INVALID_SESSION_ID_WARNING(context,sessionId,minSessionIdLength){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided session ID (").concat(sessionId,") is either invalid, not a positive integer, or not at least \"").concat(minSessionIdLength,"\" digits long. A new session ID will be auto-generated instead.");};var STORAGE_QUOTA_EXCEEDED_WARNING=function STORAGE_QUOTA_EXCEEDED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage.");};var STORAGE_UNAVAILABLE_WARNING=function STORAGE_UNAVAILABLE_WARNING(context,entry,selectedStorageType,finalStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(selectedStorageType,"\" is not available for entry \"").concat(entry,"\". The SDK will initialize the entry with \"").concat(finalStorageType,"\" storage type instead.");};var CALLBACK_INVOKE_ERROR=function CALLBACK_INVOKE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The callback threw an exception");};var INVALID_CONFIG_URL_WARNING=function INVALID_CONFIG_URL_WARNING(context,configUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided source config URL \"").concat(configUrl,"\" is invalid. Using the default source config URL instead.");};var POLYFILL_SCRIPT_LOAD_ERROR=function POLYFILL_SCRIPT_LOAD_ERROR(scriptId,url){return "Failed to load the polyfill script with ID \"".concat(scriptId,"\" from URL ").concat(url,".");};var UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY=function UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(context,selectedStrategy,defaultStrategy){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy \"").concat(selectedStrategy,"\" is not supported. Please choose one of the following supported strategies: \"none, session, anonymousId\". The default strategy \"").concat(defaultStrategy,"\" will be used instead.");};var DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY=function DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy option is deprecated. Please enable \"storage\" in the pre-consent options and use the \"storage\" load API option instead.");};var UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE=function UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(context,selectedDeliveryType,defaultDeliveryType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent events delivery type \"").concat(selectedDeliveryType,"\" is not supported. Please choose one of the following supported types: \"immediate, buffer\". The default type \"").concat(defaultDeliveryType,"\" will be used instead.");};var DEPRECATED_PLUGIN_WARNING=function DEPRECATED_PLUGIN_WARNING(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(pluginName," plugin is deprecated. Please exclude it from the load API options.");};var generateMisconfiguredPluginsWarning=function generateMisconfiguredPluginsWarning(context,configurationStatus,missingPlugins,shouldAddMissingPlugins){var isSinglePlugin=missingPlugins.length===1;var pluginsString=isSinglePlugin?" '".concat(missingPlugins[0],"' plugin was"):" ['".concat(missingPlugins.join("', '"),"'] plugins were");var baseWarning="".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(configurationStatus,", but").concat(pluginsString," not configured to load.");if(shouldAddMissingPlugins){return "".concat(baseWarning," So, ").concat(isSinglePlugin?'the plugin':'those plugins'," will be loaded automatically.");}return "".concat(baseWarning," Ignore if this was intentional. Otherwise, consider adding ").concat(isSinglePlugin?'it':'them'," to the 'plugins' load API option.");};var INVALID_POLYFILL_URL_WARNING=function INVALID_POLYFILL_URL_WARNING(context,customPolyfillUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided polyfill URL \"").concat(customPolyfillUrl,"\" is invalid. The default polyfill URL will be used instead.");};var PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING=function PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Page Unloaded event can only be tracked when the Beacon transport is active. Please enable \"useBeacon\" load API option.");};var UNKNOWN_PLUGINS_WARNING=function UNKNOWN_PLUGINS_WARNING(context,unknownPlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring unknown plugins: ").concat(unknownPlugins.join(', '),".");};var UNAVAILABLE_PLUGINS_ERROR=function UNAVAILABLE_PLUGINS_ERROR(context,unavailablePlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to load the following unavailable local plugins: ").concat(unavailablePlugins.join(', '),". Some features of the SDK may not work as expected. Make sure you are using the correct SDK bundle variant.");};var CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR=function CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR(context,destinationId){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Cannot add custom integration for destination ID \"").concat(destinationId,"\" after the SDK is loaded.");};
|
|
1035
|
+
var UNSUPPORTED_CONSENT_MANAGER_ERROR=function UNSUPPORTED_CONSENT_MANAGER_ERROR(context,selectedConsentManager,consentManagersToPluginNameMap){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The consent manager \"").concat(selectedConsentManager,"\" is not supported. Please choose one of the following supported consent managers: \"").concat(Object.keys(consentManagersToPluginNameMap),"\".");};var NON_ERROR_WARNING=function NON_ERROR_WARNING(context,errStr){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring a non-error: ").concat(errStr,".");};var BREADCRUMB_ERROR="Failed to log breadcrumb";var HANDLE_ERROR_FAILURE=function HANDLE_ERROR_FAILURE(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to handle the error.");};var PLUGIN_NAME_MISSING_ERROR=function PLUGIN_NAME_MISSING_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin name is missing.");};var PLUGIN_ALREADY_EXISTS_ERROR=function PLUGIN_ALREADY_EXISTS_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" already exists.");};var PLUGIN_NOT_FOUND_ERROR=function PLUGIN_NOT_FOUND_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found.");};var PLUGIN_ENGINE_BUG_ERROR=function PLUGIN_ENGINE_BUG_ERROR(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" not found in plugins but found in byName. This indicates a bug in the plugin engine. Please report this issue to the development team.");};var PLUGIN_DEPS_ERROR=function PLUGIN_DEPS_ERROR(context,pluginName,notExistDeps){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Plugin \"").concat(pluginName,"\" could not be loaded because some of its dependencies \"").concat(notExistDeps,"\" do not exist.");};var PLUGIN_INVOCATION_ERROR=function PLUGIN_INVOCATION_ERROR(context,extPoint,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to invoke the \"").concat(extPoint,"\" extension point of plugin \"").concat(pluginName,"\".");};var SOURCE_CONFIG_FETCH_ERROR='Failed to fetch the source config';var WRITE_KEY_VALIDATION_ERROR=function WRITE_KEY_VALIDATION_ERROR(context,writeKey){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The write key \"").concat(writeKey,"\" is invalid. It must be a non-empty string. Please check that the write key is correct and try again.");};var DATA_PLANE_URL_VALIDATION_ERROR=function DATA_PLANE_URL_VALIDATION_ERROR(context,dataPlaneUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The data plane URL \"").concat(dataPlaneUrl,"\" is invalid. It must be a valid URL string. Please check that the data plane URL is correct and try again.");};var INVALID_CALLBACK_FN_ERROR=function INVALID_CALLBACK_FN_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided callback parameter is not a function.");};var XHR_DELIVERY_ERROR=function XHR_DELIVERY_ERROR(prefix,status,statusText,url,response){return "".concat(prefix," with status ").concat(status," (").concat(statusText,") for URL: ").concat(url,". Response: ").concat(response.trim());};var XHR_REQUEST_ERROR=function XHR_REQUEST_ERROR(prefix,e,url){return "".concat(prefix," due to timeout or no connection (").concat(e?e.type:'',") at the client side for URL: ").concat(url);};var XHR_SEND_ERROR=function XHR_SEND_ERROR(prefix,url){return "".concat(prefix," for URL: ").concat(url);};var STORE_DATA_SAVE_ERROR=function STORE_DATA_SAVE_ERROR(key){return "Failed to save the value for \"".concat(key,"\" to storage");};var STORE_DATA_FETCH_ERROR=function STORE_DATA_FETCH_ERROR(key){return "Failed to retrieve or parse data for \"".concat(key,"\" from storage");};var DATA_SERVER_URL_INVALID_ERROR=function DATA_SERVER_URL_INVALID_ERROR(context,url){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The server side cookies functionality is disabled as the provided data server URL, \"").concat(url,"\" is invalid.");};var DATA_SERVER_REQUEST_FAIL_ERROR=function DATA_SERVER_REQUEST_FAIL_ERROR(status){return "The server responded with status ".concat(status," while setting the cookies. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_ERROR=function FAILED_SETTING_COOKIE_FROM_SERVER_ERROR(key){return "The server failed to set the ".concat(key," cookie. As a fallback, the cookies will be set client side.");};var FAILED_SETTING_COOKIE_FROM_SERVER_GLOBAL_ERROR="Failed to set/remove cookies via server. As a fallback, the cookies will be managed client side.";var COLLAPSED_COOKIE_BATCH_ERROR=function COLLAPSED_COOKIE_BATCH_ERROR(missingCookies,batchSize){return "The server did not set ".concat(missingCookies.length," of the ").concat(batchSize," cookies sent in one request: ").concat(missingCookies.join(', '),". A fallback to set them client side was attempted. Check that the data service and any proxy preserve every \"Set-Cookie\" header, and that the cookie domain and SameSite/Secure attributes are valid.");};// WARNING
|
|
1036
|
+
var STORAGE_TYPE_VALIDATION_WARNING=function STORAGE_TYPE_VALIDATION_WARNING(context,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING=function UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entry,storageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(storageType,"\" configured for the entry \"").concat(entry,"\" is not supported. Please choose one of the following supported types: \"").concat(SUPPORTED_STORAGE_TYPES,"\". The default storage type will be used instead.");};var UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING=function UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(context,selectedStorageEncryptionVersion,storageEncryptionVersionsToPluginNameMap,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage encryption version \"").concat(selectedStorageEncryptionVersion,"\" is not supported. Please choose one of the following supported versions: \"").concat(Object.keys(storageEncryptionVersionsToPluginNameMap),"\". The default version \"").concat(defaultVersion,"\" will be used instead.");};var STORAGE_DATA_MIGRATION_OVERRIDE_WARNING=function STORAGE_DATA_MIGRATION_OVERRIDE_WARNING(context,storageEncryptionVersion,defaultVersion){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage data migration has been disabled because the configured storage encryption version (").concat(storageEncryptionVersion,") is not the latest (").concat(defaultVersion,"). To enable storage data migration, please update the storage encryption version to the latest version.");};var SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_ERROR=function SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_ERROR(context,providedCookieDomain,currentCookieDomain){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided cookie domain (").concat(providedCookieDomain,") does not match the current webpage's domain (").concat(currentCookieDomain,"). Hence, the cookies will be set client-side.");};var SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR=function SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR(context,dataServiceHost,webpageHost){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The data service host (").concat(dataServiceHost,") cannot set cookies for the current webpage (").concat(webpageHost,"). Hence, the cookies will be set client-side instead of server-side.");};var RESERVED_KEYWORD_WARNING=function RESERVED_KEYWORD_WARNING(context,property,parentKeyPath,reservedElements){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The \"").concat(property,"\" property defined under \"").concat(parentKeyPath,"\" is a reserved keyword. Please choose a different property name to avoid conflicts with reserved keywords (").concat(reservedElements,").");};var RESERVED_CUSTOM_CONTEXT_KEY_WARNING=function RESERVED_CUSTOM_CONTEXT_KEY_WARNING(logContext,property){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"The top-level custom context property \"").concat(property,"\" is reserved and was ignored.");};var INVALID_CONTEXT_OBJECT_WARNING=function INVALID_CONTEXT_OBJECT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Please make sure that the \"context\" property in the event API's \"options\" argument is a valid object literal with key-value pairs.");};var INVALID_CUSTOM_CONTEXT_WARNING=function INVALID_CUSTOM_CONTEXT_WARNING(logContext){return "".concat(logContext).concat(LOG_CONTEXT_SEPARATOR,"Invalid custom context. Use a plain object without prototype pollution keys.");};var UNSUPPORTED_BEACON_API_WARNING=function UNSUPPORTED_BEACON_API_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The Beacon API is not supported by your browser. The events will be sent using XHR instead.");};var TIMEOUT_NOT_NUMBER_WARNING=function TIMEOUT_NOT_NUMBER_WARNING(context,timeout,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value \"").concat(timeout,"\" is not a number. The default timeout of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_NOT_NUMBER_WARNING=function CUT_OFF_DURATION_NOT_NUMBER_WARNING(context,cutOffDuration,defaultValue){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" is not a number. The default cut off duration of ").concat(defaultValue," ms will be used instead.");};var CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING=function CUT_OFF_DURATION_LESS_THAN_TIMEOUT_WARNING(context,cutOffDuration,timeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session cut off duration value \"").concat(cutOffDuration,"\" ms is less than the session timeout value \"").concat(timeout,"\" ms. The cut off functionality will be disabled.");};var TIMEOUT_ZERO_WARNING=function TIMEOUT_ZERO_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value is 0, which disables the automatic session tracking feature. If you want to enable session tracking, please provide a positive integer value for the timeout.");};var TIMEOUT_NOT_RECOMMENDED_WARNING=function TIMEOUT_NOT_RECOMMENDED_WARNING(context,timeout,minTimeout){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The session timeout value ").concat(timeout," ms is less than the recommended minimum of ").concat(minTimeout," ms. Please consider increasing the timeout value to ensure optimal performance and reliability.");};var INVALID_SESSION_ID_WARNING=function INVALID_SESSION_ID_WARNING(context,sessionId,minSessionIdLength){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided session ID (").concat(sessionId,") is either invalid, not a positive integer, or not at least \"").concat(minSessionIdLength,"\" digits long. A new session ID will be auto-generated instead.");};var STORAGE_QUOTA_EXCEEDED_WARNING=function STORAGE_QUOTA_EXCEEDED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage is either full or unavailable, so the data will not be persisted. Switching to in-memory storage.");};var STORAGE_UNAVAILABLE_WARNING=function STORAGE_UNAVAILABLE_WARNING(context,entry,selectedStorageType,finalStorageType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The storage type \"").concat(selectedStorageType,"\" is not available for entry \"").concat(entry,"\". The SDK will initialize the entry with \"").concat(finalStorageType,"\" storage type instead.");};var CALLBACK_INVOKE_ERROR=function CALLBACK_INVOKE_ERROR(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The callback threw an exception");};var INVALID_CONFIG_URL_WARNING=function INVALID_CONFIG_URL_WARNING(context,configUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided source config URL \"").concat(configUrl,"\" is invalid. Using the default source config URL instead.");};var POLYFILL_SCRIPT_LOAD_ERROR=function POLYFILL_SCRIPT_LOAD_ERROR(scriptId,url){return "Failed to load the polyfill script with ID \"".concat(scriptId,"\" from URL ").concat(url,".");};var UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY=function UNSUPPORTED_PRE_CONSENT_STORAGE_STRATEGY(context,selectedStrategy,defaultStrategy){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy \"").concat(selectedStrategy,"\" is not supported. Please choose one of the following supported strategies: \"none, session, anonymousId\". The default strategy \"").concat(defaultStrategy,"\" will be used instead.");};var DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY=function DEPRECATED_PRE_CONSENT_STORAGE_STRATEGY(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent storage strategy option is deprecated. Please enable \"storage\" in the pre-consent options and use the \"storage\" load API option instead.");};var UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE=function UNSUPPORTED_PRE_CONSENT_EVENTS_DELIVERY_TYPE(context,selectedDeliveryType,defaultDeliveryType){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The pre-consent events delivery type \"").concat(selectedDeliveryType,"\" is not supported. Please choose one of the following supported types: \"immediate, buffer\". The default type \"").concat(defaultDeliveryType,"\" will be used instead.");};var DEPRECATED_PLUGIN_WARNING=function DEPRECATED_PLUGIN_WARNING(context,pluginName){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(pluginName," plugin is deprecated. Please exclude it from the load API options.");};var generateMisconfiguredPluginsWarning=function generateMisconfiguredPluginsWarning(context,configurationStatus,missingPlugins,shouldAddMissingPlugins){var isSinglePlugin=missingPlugins.length===1;var pluginsString=isSinglePlugin?" '".concat(missingPlugins[0],"' plugin was"):" ['".concat(missingPlugins.join("', '"),"'] plugins were");var baseWarning="".concat(context).concat(LOG_CONTEXT_SEPARATOR).concat(configurationStatus,", but").concat(pluginsString," not configured to load.");if(shouldAddMissingPlugins){return "".concat(baseWarning," So, ").concat(isSinglePlugin?'the plugin':'those plugins'," will be loaded automatically.");}return "".concat(baseWarning," Ignore if this was intentional. Otherwise, consider adding ").concat(isSinglePlugin?'it':'them'," to the 'plugins' load API option.");};var INVALID_POLYFILL_URL_WARNING=function INVALID_POLYFILL_URL_WARNING(context,customPolyfillUrl){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"The provided polyfill URL \"").concat(customPolyfillUrl,"\" is invalid. The default polyfill URL will be used instead.");};var PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING=function PAGE_UNLOAD_ON_BEACON_DISABLED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Page Unloaded event can only be tracked when the Beacon transport is active. Please enable \"useBeacon\" load API option.");};var UNKNOWN_PLUGINS_WARNING=function UNKNOWN_PLUGINS_WARNING(context,unknownPlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Ignoring unknown plugins: ").concat(unknownPlugins.join(', '),".");};var UNAVAILABLE_PLUGINS_ERROR=function UNAVAILABLE_PLUGINS_ERROR(context,unavailablePlugins){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to load the following unavailable local plugins: ").concat(unavailablePlugins.join(', '),". Some features of the SDK may not work as expected. Make sure you are using the correct SDK bundle variant.");};var CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR=function CUSTOM_INTEGRATION_CANNOT_BE_ADDED_ERROR(context,destinationId){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Cannot add custom integration for destination ID \"").concat(destinationId,"\" after the SDK is loaded.");};
|
|
1037
1037
|
|
|
1038
1038
|
var DEFAULT_INTEGRATIONS_CONFIG={All:true};
|
|
1039
1039
|
|
|
@@ -1129,7 +1129,8 @@ xhr.timeout=timeout;Object.keys(options.headers).forEach(function(headerName){if
|
|
|
1129
1129
|
* Implement requests in a blocking way
|
|
1130
1130
|
*/},{key:"getData",value:(function(){var _getData=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(config){var url,options,timeout,isRawResponse,data,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse;_context.p=1;_context.n=2;return xhrRequest(createXhrRequestOptions(url,options,this.basicAuthHeader),timeout,this.logger);case 2:data=_context.v;return _context.a(2,{data:isRawResponse?data.response:responseTextToJson(data.response,this.onError),details:data});case 3:_context.p=3;_t=_context.v;return _context.a(2,{data:undefined,details:_t});}},_callee,this,[[1,3]]);}));function getData(_x){return _getData.apply(this,arguments);}return getData;}()/**
|
|
1131
1131
|
* Implement requests in a non-blocking way
|
|
1132
|
-
*/)},{key:"getAsyncData",value:function getAsyncData(config){var _this=this;var callback=config.callback,url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse;var isFireAndForget=!isFunction(callback);xhrRequest(createXhrRequestOptions(url,options,this.basicAuthHeader),timeout,this.logger).then(function(data){if(!isFireAndForget){callback(isRawResponse?data.response:responseTextToJson(data.response,_this.onError),data);}}
|
|
1132
|
+
*/)},{key:"getAsyncData",value:function getAsyncData(config){var _this=this;var callback=config.callback,url=config.url,options=config.options,timeout=config.timeout,isRawResponse=config.isRawResponse;var isFireAndForget=!isFunction(callback);xhrRequest(createXhrRequestOptions(url,options,this.basicAuthHeader),timeout,this.logger).then(function(data){if(!isFireAndForget){callback(isRawResponse?data.response:responseTextToJson(data.response,_this.onError),data);}},function(data){if(!isFireAndForget){callback(undefined,data);}})// Exceptions thrown by the callback must never re-enter it
|
|
1133
|
+
.catch(this.onError);}/**
|
|
1133
1134
|
* Handle errors
|
|
1134
1135
|
*/},{key:"onError",value:function onError(error,groupingHash){var _this$errorHandler;(_this$errorHandler=this.errorHandler)===null||_this$errorHandler===void 0||_this$errorHandler.onError({error:error,context:HTTP_CLIENT,groupingHash:groupingHash});}/**
|
|
1135
1136
|
* Set basic authentication header (eg writekey)
|
|
@@ -1381,13 +1382,16 @@ var DEFAULT_BEACON_QUEUE_OPTIONS={maxItems:DEFAULT_BEACON_QUEUE_MAX_SIZE,flushQu
|
|
|
1381
1382
|
|
|
1382
1383
|
var ScheduleModes=/*#__PURE__*/function(ScheduleModes){ScheduleModes[ScheduleModes["ASAP"]=1]="ASAP";ScheduleModes[ScheduleModes["RESCHEDULE"]=2]="RESCHEDULE";ScheduleModes[ScheduleModes["ABANDON"]=3]="ABANDON";return ScheduleModes;}({});var DEFAULT_CLOCK_LATE_FACTOR=2;var DEFAULT_CLOCK={setTimeout:function setTimeout(fn,ms){return globalThis.setTimeout(fn,ms);},clearTimeout:function clearTimeout(id){return globalThis.clearTimeout(id);},Date:globalThis.Date,clockLateFactor:DEFAULT_CLOCK_LATE_FACTOR};var Schedule=/*#__PURE__*/function(){function Schedule(){_classCallCheck(this,Schedule);this.tasks={};this.nextId=1;this.clock=DEFAULT_CLOCK;}return _createClass(Schedule,[{key:"now",value:function now(){return +new this.clock.Date();}},{key:"run",value:function run(task,timeout,mode){if(this.nextId===Number.MAX_SAFE_INTEGER){this.nextId=1;}var id=(this.nextId++).toString();this.tasks[id]=this.clock.setTimeout(this.handle(id,task,timeout,mode||ScheduleModes.ASAP),timeout);return id;}},{key:"handle",value:function handle(id,callback,timeout,mode){var _this=this;var start=this.now();return function(){delete _this.tasks[id];var elapsedTimeoutTime=start+timeout*(_this.clock.clockLateFactor||DEFAULT_CLOCK_LATE_FACTOR);var currentTime=_this.now();var notCompletedOrTimedOut=mode>=ScheduleModes.RESCHEDULE&&elapsedTimeoutTime<currentTime;if(notCompletedOrTimedOut){if(mode===ScheduleModes.RESCHEDULE){_this.run(callback,timeout,mode);}return undefined;}return callback();};}},{key:"cancel",value:function cancel(id){if(this.tasks[id]){this.clock.clearTimeout(this.tasks[id]);delete this.tasks[id];}}},{key:"cancelAll",value:function cancelAll(){Object.values(this.tasks).forEach(this.clock.clearTimeout);this.tasks={};}}]);}();
|
|
1383
1384
|
|
|
1384
|
-
var RETRY_QUEUE_PROCESS_ERROR=function RETRY_QUEUE_PROCESS_ERROR(context,errMsg){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"An unknown error occurred while processing the queue item. ").concat(errMsg);};var RETRY_QUEUE_ENTRY_REMOVE_ERROR=function RETRY_QUEUE_ENTRY_REMOVE_ERROR(context,entry,attempt){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to remove local storage entry \"").concat(entry,"\" (attempt: ").concat(attempt,".");};
|
|
1385
|
+
var RETRY_QUEUE_PROCESS_ERROR=function RETRY_QUEUE_PROCESS_ERROR(context,errMsg){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"An unknown error occurred while processing the queue item. ").concat(errMsg);};var RETRY_QUEUE_ENTRY_REMOVE_ERROR=function RETRY_QUEUE_ENTRY_REMOVE_ERROR(context,entry,attempt){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Failed to remove local storage entry \"").concat(entry,"\" (attempt: ").concat(attempt,".");};var RETRY_QUEUE_NAME_COLLISION_ERROR=function RETRY_QUEUE_NAME_COLLISION_ERROR(context,name){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Another queue named \"").concat(name,"\" is already running. Queues sharing a name reclaim each other's items.");};
|
|
1385
1386
|
|
|
1386
1387
|
var DEFAULT_MIN_RETRY_DELAY_MS=1000;var DEFAULT_MAX_RETRY_DELAY_MS=30000;var DEFAULT_BACKOFF_FACTOR=2;var DEFAULT_BACKOFF_JITTER=0;var DEFAULT_MAX_RETRY_ATTEMPTS=Infinity;var DEFAULT_MAX_ITEMS=Infinity;var DEFAULT_ACK_TIMER_MS=1000;var DEFAULT_RECLAIM_TIMER_MS=3000;var DEFAULT_RECLAIM_TIMEOUT_MS=10000;var DEFAULT_RECLAIM_WAIT_MS=500;var MIN_TIMER_SCALE_FACTOR=1;var MAX_TIMER_SCALE_FACTOR=10;var DEFAULT_MAX_BATCH_SIZE_BYTES=512*1024;// 512 KB; this is also the max size of a batch
|
|
1387
1388
|
var DEFAULT_MAX_BATCH_ITEMS=100;var DEFAULT_BATCH_FLUSH_INTERVAL_MS=60*1000;// 1 minutes
|
|
1388
1389
|
var BATCH_QUEUE_ITEM_TYPE='Batch';var SINGLE_QUEUE_ITEM_TYPE='Single';
|
|
1389
1390
|
|
|
1390
|
-
var sortByTime=function sortByTime(a,b){return a.time-b.time;};var RETRY_QUEUE='RetryQueue'
|
|
1391
|
+
var sortByTime=function sortByTime(a,b){return a.time-b.time;};var RETRY_QUEUE='RetryQueue';// Ids of the queues currently running on this page, keyed by queue name.
|
|
1392
|
+
// findOtherQueues matches donor queues on the name alone, so two running queues
|
|
1393
|
+
// sharing one will reclaim each other's items.
|
|
1394
|
+
var runningQueueIdsByName=new Map();var RetryQueue=/*#__PURE__*/function(){/**
|
|
1391
1395
|
* Constructs a RetryQueue backed by localStorage
|
|
1392
1396
|
*
|
|
1393
1397
|
* @param {String} name The name of the queue. Will be used to find abandoned queues and retry their items
|
|
@@ -1407,9 +1411,9 @@ this.flushBatchOnPageLeave();this.scheduleTimeoutActive=false;}return _createCla
|
|
|
1407
1411
|
this.batch.maxSize=Math.min((_batchOptions$maxSize=batchOptions.maxSize)!==null&&_batchOptions$maxSize!==void 0?_batchOptions$maxSize:DEFAULT_MAX_BATCH_SIZE_BYTES,DEFAULT_MAX_BATCH_SIZE_BYTES);this.batch.maxItems=(_batchOptions$maxItem=batchOptions.maxItems)!==null&&_batchOptions$maxItem!==void 0?_batchOptions$maxItem:DEFAULT_MAX_BATCH_ITEMS;this.batch.flushInterval=(_batchOptions$flushIn=batchOptions.flushInterval)!==null&&_batchOptions$flushIn!==void 0?_batchOptions$flushIn:DEFAULT_BATCH_FLUSH_INTERVAL_MS;}}},{key:"flushBatchOnPageLeave",value:function flushBatchOnPageLeave(){if(this.batch.enabled){onPageLeave(this.flushBatch);}}},{key:"getStorageEntry",value:function getStorageEntry(name){return this.store.get(name);}// TODO: fix the type of different queues to be the same if possible
|
|
1408
1412
|
},{key:"setStorageEntry",value:function setStorageEntry(name,value){if(isNullOrUndefined(value)){this.store.remove(name);}else {this.store.set(name,value);}}/**
|
|
1409
1413
|
* Stops processing the queue
|
|
1410
|
-
*/},{key:"stop",value:function stop(){this.schedule.cancelAll();this.scheduleTimeoutActive=false;}/**
|
|
1414
|
+
*/},{key:"stop",value:function stop(){this.schedule.cancelAll();this.scheduleTimeoutActive=false;var runningQueueIds=runningQueueIdsByName.get(this.name);runningQueueIds===null||runningQueueIds===void 0||runningQueueIds.delete(this.id);if((runningQueueIds===null||runningQueueIds===void 0?void 0:runningQueueIds.size)===0){runningQueueIdsByName.delete(this.name);}}/**
|
|
1411
1415
|
* Starts processing the queue
|
|
1412
|
-
*/},{key:"start",value:function start(){if(this.scheduleTimeoutActive){this.stop();}this.scheduleTimeoutActive=true;this.scheduleFlushBatch();this.ack();this.checkReclaim();this.processHead();}/**
|
|
1416
|
+
*/},{key:"start",value:function start(){var _runningQueueIdsByNam;if(this.scheduleTimeoutActive){this.stop();}var runningQueueIds=(_runningQueueIdsByNam=runningQueueIdsByName.get(this.name))!==null&&_runningQueueIdsByNam!==void 0?_runningQueueIdsByNam:new Set();if(runningQueueIds.size>0&&!runningQueueIds.has(this.id)){var _this$logger;(_this$logger=this.logger)===null||_this$logger===void 0||_this$logger.error(RETRY_QUEUE_NAME_COLLISION_ERROR(RETRY_QUEUE,this.name));}runningQueueIds.add(this.id);runningQueueIdsByName.set(this.name,runningQueueIds);this.scheduleTimeoutActive=true;this.scheduleFlushBatch();this.ack();this.checkReclaim();this.processHead();}/**
|
|
1413
1417
|
* Configures the timeout handler for flushing the batch queue
|
|
1414
1418
|
*/},{key:"scheduleFlushBatch",value:function scheduleFlushBatch(){var _this$batch;if(this.batch.enabled&&(_this$batch=this.batch)!==null&&_this$batch!==void 0&&_this$batch.flushInterval){if(this.flushBatchTaskId){this.schedule.cancel(this.flushBatchTaskId);}this.flushBatchTaskId=this.schedule.run(this.flushBatch,this.batch.flushInterval,ScheduleModes.ASAP);}}/**
|
|
1415
1419
|
* Flushes the batch queue
|
|
@@ -1462,12 +1466,18 @@ reclaimed=(_inProgressItem$recla=inProgressItem.reclaimed)!==null&&_inProgressIt
|
|
|
1462
1466
|
inProgressItem.firstAttemptedAt=firstAttemptedAt;// Update the last attempted at to current timestamp for the in progress item
|
|
1463
1467
|
inProgressItem.lastAttemptedAt=_now;_inProgress[el.id]=inProgressItem;_this.setStorageEntry(QueueStatuses.IN_PROGRESS,_inProgress);}// A decimal integer representing the milliseconds since the first attempt
|
|
1464
1468
|
var timeSinceFirstAttempt=_now-firstAttemptedAt;// A decimal integer representing the milliseconds since the last attempt
|
|
1465
|
-
var timeSinceLastAttempt=_now-lastAttemptedAt;var willBeRetried=_this.shouldRetry(el.item,el.attemptNumber+1);_this.processQueueCb(el.item,el.done,{retryAttemptNumber:el.attemptNumber,maxRetryAttempts:_this.maxAttempts,willBeRetried:willBeRetried,timeSinceFirstAttempt:timeSinceFirstAttempt,timeSinceLastAttempt:timeSinceLastAttempt,reclaimed:reclaimed,isPageAccessible:_this.isPageAccessible,retryReason:retryReason});}catch(err){var _this$
|
|
1469
|
+
var timeSinceLastAttempt=_now-lastAttemptedAt;var willBeRetried=_this.shouldRetry(el.item,el.attemptNumber+1);_this.processQueueCb(el.item,el.done,{retryAttemptNumber:el.attemptNumber,maxRetryAttempts:_this.maxAttempts,willBeRetried:willBeRetried,timeSinceFirstAttempt:timeSinceFirstAttempt,timeSinceLastAttempt:timeSinceLastAttempt,reclaimed:reclaimed,isPageAccessible:_this.isPageAccessible,retryReason:retryReason});}catch(err){var _this$logger2;var errMsg='';if(el.attemptNumber<_this.maxAttempts){errMsg='The item will be requeued.';if(el.attemptNumber>0){errMsg="".concat(errMsg," Retry attempt ").concat(el.attemptNumber," of ").concat(_this.maxAttempts,".");}// requeue the item to be retried
|
|
1466
1470
|
el.done(err);}else {errMsg="Retries exhausted (".concat(_this.maxAttempts,"). The item will be dropped.");// drop the event as we're unable to process it
|
|
1467
1471
|
// after the max attempts are exhausted
|
|
1468
|
-
el.done();}(_this$
|
|
1472
|
+
el.done();}(_this$logger2=_this.logger)===null||_this$logger2===void 0||_this$logger2.error(RETRY_QUEUE_PROCESS_ERROR(RETRY_QUEUE,errMsg),err);}});// re-read the queue in case the process function finished immediately or added another item
|
|
1469
1473
|
queue=(_ref8=this.getStorageEntry(QueueStatuses.QUEUE))!==null&&_ref8!==void 0?_ref8:[];this.schedule.cancel(this.processId);if(queue.length>0){var nextProcessExecutionTime=queue[0].time-now;this.processId=this.schedule.run(this.processHead,nextProcessExecutionTime,ScheduleModes.ASAP);}}// Ack continuously to prevent other tabs from claiming our queue
|
|
1470
|
-
},{key:"ack",value:function ack(){this.setStorageEntry(QueueStatuses.ACK,this.schedule.now());if(this.reclaimStartVal!=null){this.reclaimStartVal=null;this.setStorageEntry(QueueStatuses.RECLAIM_START,null);}if(this.reclaimEndVal!=null){this.reclaimEndVal=null;this.setStorageEntry(QueueStatuses.RECLAIM_END,null);}this.schedule.run(this.ack,this.timeouts.ackTimer,ScheduleModes.ASAP);}
|
|
1474
|
+
},{key:"ack",value:function ack(){this.setStorageEntry(QueueStatuses.ACK,this.schedule.now());if(this.reclaimStartVal!=null){this.reclaimStartVal=null;this.setStorageEntry(QueueStatuses.RECLAIM_START,null);}if(this.reclaimEndVal!=null){this.reclaimEndVal=null;this.setStorageEntry(QueueStatuses.RECLAIM_END,null);}this.schedule.run(this.ack,this.timeouts.ackTimer,ScheduleModes.ASAP);}/**
|
|
1475
|
+
* Take over the items of another queue.
|
|
1476
|
+
*
|
|
1477
|
+
* Reads through the handle `findOtherQueues` discovered rather than building a
|
|
1478
|
+
* fresh one: a quota error during the handshake swaps that handle to the
|
|
1479
|
+
* in-memory engine, and a new localStorage store would find nothing.
|
|
1480
|
+
*/},{key:"reclaim",value:function reclaim(other){var _this$getStorageEntry,_other$get,_other$get2,_other$get3,_this2=this;var our={queue:(_this$getStorageEntry=this.getStorageEntry(QueueStatuses.QUEUE))!==null&&_this$getStorageEntry!==void 0?_this$getStorageEntry:[]};var their={inProgress:(_other$get=other.get(QueueStatuses.IN_PROGRESS))!==null&&_other$get!==void 0?_other$get:{},batchQueue:(_other$get2=other.get(QueueStatuses.BATCH_QUEUE))!==null&&_other$get2!==void 0?_other$get2:[],queue:(_other$get3=other.get(QueueStatuses.QUEUE))!==null&&_other$get3!==void 0?_other$get3:[]};var trackMessageIds=[];var addConcatQueue=function addConcatQueue(queue,incrementAttemptNumberBy){var concatIterator=function concatIterator(el){var _el$id;var id=(_el$id=el.id)!==null&&_el$id!==void 0?_el$id:generateUUID();if(trackMessageIds.includes(id));else {var _el$type;// Hack to determine the item type by the contents of the entry
|
|
1471
1481
|
// After some point, we can remove this hack as most of the stale data will have been processed
|
|
1472
1482
|
// and the new entries will have the type field set
|
|
1473
1483
|
var type=Array.isArray(el.item)?BATCH_QUEUE_ITEM_TYPE:SINGLE_QUEUE_ITEM_TYPE;our.queue.push({item:el.item,attemptNumber:el.attemptNumber+incrementAttemptNumberBy,time:_this2.schedule.now(),id:id,type:(_el$type=el.type)!==null&&_el$type!==void 0?_el$type:type,firstAttemptedAt:el.firstAttemptedAt,lastAttemptedAt:el.lastAttemptedAt,retryReason:el.retryReason,// Mark the item as reclaimed from local storage
|
|
@@ -1481,9 +1491,12 @@ this.clearQueueEntries(other,1);// process the new items we claimed
|
|
|
1481
1491
|
this.processHead();}},{key:"clearQueueEntries",value:function clearQueueEntries(other,localStorageBackoff){this.removeStorageEntry(other,0,localStorageBackoff);}},{key:"removeStorageEntry",value:function removeStorageEntry(store,entryIdx,backoff){var _this3=this;var attempt=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;var maxAttempts=2;var queueEntryKeys=Object.keys(QueueStatuses);var entry=QueueStatuses[queueEntryKeys[entryIdx]];globalThis.setTimeout(function(){try{store.remove(entry);// clear the next entry
|
|
1482
1492
|
if(entryIdx+1<queueEntryKeys.length){_this3.removeStorageEntry(store,entryIdx+1,backoff);}}catch(err){var storageBusyErr='NS_ERROR_STORAGE_BUSY';var isLocalStorageBusy=err.name===storageBusyErr||err.code===storageBusyErr||err.code===0x80630001;if(isLocalStorageBusy&&attempt<maxAttempts){// Try clearing the same entry again with some extra delay
|
|
1483
1493
|
_this3.removeStorageEntry(store,entryIdx,backoff+40,attempt+1);}else {var _this3$logger;(_this3$logger=_this3.logger)===null||_this3$logger===void 0||_this3$logger.error(RETRY_QUEUE_ENTRY_REMOVE_ERROR(RETRY_QUEUE,entry,attempt),err);}// clear the next entry after we've exhausted our attempts
|
|
1484
|
-
if(attempt===maxAttempts&&entryIdx+1<queueEntryKeys.length){_this3.removeStorageEntry(store,entryIdx+1,backoff);}}},backoff);}},{key:"checkReclaim",value:function checkReclaim(){var _this4=this;var createReclaimStartTask=function createReclaimStartTask(store){return function(){if(store.get(QueueStatuses.RECLAIM_END)!==_this4.id){return;}if(store.get(QueueStatuses.RECLAIM_START)!==_this4.id){return;}_this4.reclaim(store
|
|
1494
|
+
if(attempt===maxAttempts&&entryIdx+1<queueEntryKeys.length){_this3.removeStorageEntry(store,entryIdx+1,backoff);}}},backoff);}},{key:"checkReclaim",value:function checkReclaim(){var _this4=this;var createReclaimStartTask=function createReclaimStartTask(store){return function(){if(store.get(QueueStatuses.RECLAIM_END)!==_this4.id){return;}if(store.get(QueueStatuses.RECLAIM_START)!==_this4.id){return;}_this4.reclaim(store);};};var createReclaimEndTask=function createReclaimEndTask(store){return function(){if(store.get(QueueStatuses.RECLAIM_START)!==_this4.id){return;}store.set(QueueStatuses.RECLAIM_END,_this4.id);_this4.schedule.run(createReclaimStartTask(store),_this4.timeouts.reclaimWait,ScheduleModes.ABANDON);};};var tryReclaim=function tryReclaim(store){store.set(QueueStatuses.RECLAIM_START,_this4.id);store.set(QueueStatuses.ACK,_this4.schedule.now());_this4.schedule.run(createReclaimEndTask(store),_this4.timeouts.reclaimWait,ScheduleModes.ABANDON);};var findOtherQueues=function findOtherQueues(name){var res=[];var storageEngine=_this4.store.getOriginalEngine();var storageKeys=[];// 'keys' API is not supported by all the core SDK versions
|
|
1485
1495
|
// Hence, we need this backward compatibility check
|
|
1486
|
-
if(isFunction(storageEngine.keys)){storageKeys=storageEngine.keys();}else {for(var i=0;i<storageEngine.length;i++){var key=storageEngine.key(i);if(key){storageKeys.push(key);}}}storageKeys.forEach(function(k){var keyParts=k?k.split('.'):[];if(keyParts.length>=3&&keyParts[0]===name&&keyParts[1]!==_this4.id&&keyParts[2]===QueueStatuses.ACK){res.push(_this4.storeManager.setStore({id:keyParts[1],name:name,validKeys:QueueStatuses,type:LOCAL_STORAGE
|
|
1496
|
+
if(isFunction(storageEngine.keys)){storageKeys=storageEngine.keys();}else {for(var i=0;i<storageEngine.length;i++){var key=storageEngine.key(i);if(key){storageKeys.push(key);}}}storageKeys.forEach(function(k){var keyParts=k?k.split('.'):[];if(keyParts.length>=3&&keyParts[0]===name&&keyParts[1]!==_this4.id&&keyParts[2]===QueueStatuses.ACK){res.push(_this4.storeManager.setStore({id:keyParts[1],name:name,validKeys:QueueStatuses,type:LOCAL_STORAGE,// This store stands in for another queue's entries. If its storage is
|
|
1497
|
+
// full it must keep them where they are: moving them to memory drops
|
|
1498
|
+
// the durable copy, and an abandoned handshake then loses them for good.
|
|
1499
|
+
noSwapOnQuota:true,errorHandler:_this4.storeManager.errorHandler,logger:_this4.storeManager.logger}));}});return res;};findOtherQueues(this.name).forEach(function(store){if(_this4.schedule.now()-store.get(QueueStatuses.ACK)<_this4.timeouts.reclaimTimeout){return;}tryReclaim(store);});this.schedule.run(this.checkReclaim,this.timeouts.reclaimTimer,ScheduleModes.RESCHEDULE);}},{key:"clear",value:function clear(){this.schedule.cancelAll();this.setDefaultQueueEntries();}}]);}();
|
|
1487
1500
|
|
|
1488
1501
|
var pluginName$d='BeaconQueue';var BeaconQueue=function BeaconQueue(){return {name:pluginName$d,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$d]);},dataplaneEventsQueue:{/**
|
|
1489
1502
|
* Initialize the queue for delivery
|
|
@@ -1545,37 +1558,39 @@ var isDestIntgConfigTruthy=function isDestIntgConfigTruthy(destIntgConfig){retur
|
|
|
1545
1558
|
Original file: https://github.com/rudderlabs/rudder-integrations-config/blob/develop/generated/Destinations.ts
|
|
1546
1559
|
|
|
1547
1560
|
NOTE: Contains only constants for device mode destinations
|
|
1548
|
-
*/var ACTIVE_CAMPAIGN_NAME='ACTIVE_CAMPAIGN';var ACTIVE_CAMPAIGN_DISPLAY_NAME='ActiveCampaign';var ADOBE_ANALYTICS_NAME='ADOBE_ANALYTICS';var ADOBE_ANALYTICS_DISPLAY_NAME='Adobe Analytics';var ADROLL_NAME='ADROLL';var ADROLL_DISPLAY_NAME='Adroll';var AM_NAME='AM';var AM_DISPLAY_NAME='Amplitude';var APPCUES_NAME='APPCUES';var APPCUES_DISPLAY_NAME='Appcues';var AXEPTIO_NAME='AXEPTIO';var AXEPTIO_DISPLAY_NAME='Axeptio';var BINGADS_NAME='BINGADS';var BINGADS_DISPLAY_NAME='Bing Ads';var BRAZE_NAME='BRAZE';var BRAZE_DISPLAY_NAME='Braze';var BUGSNAG_NAME='BUGSNAG';var BUGSNAG_DISPLAY_NAME='Bugsnag';var CHARTBEAT_NAME='CHARTBEAT';var CHARTBEAT_DISPLAY_NAME='Chartbeat';var CLEVERTAP_NAME='CLEVERTAP';var CLEVERTAP_DISPLAY_NAME='CleverTap';var COMMANDBAR_NAME='COMMANDBAR';var COMMANDBAR_DISPLAY_NAME='CommandBar';var COMSCORE_NAME='COMSCORE';var COMSCORE_DISPLAY_NAME='Comscore';var CONVERTFLOW_NAME='CONVERTFLOW';var CONVERTFLOW_DISPLAY_NAME='Convertflow';var CRITEO_NAME='CRITEO';var CRITEO_DISPLAY_NAME='Criteo';var CUSTOMERIO_NAME='CUSTOMERIO';var CUSTOMERIO_DISPLAY_NAME='Customer IO';var DCM_FLOODLIGHT_NAME='DCM_FLOODLIGHT';var DCM_FLOODLIGHT_DISPLAY_NAME='DCM Floodlight';var DRIP_NAME='DRIP';var DRIP_DISPLAY_NAME='Drip';var ENGAGE_NAME='ENGAGE';var ENGAGE_DISPLAY_NAME='Engage';var FACEBOOK_PIXEL_NAME='FACEBOOK_PIXEL';var FACEBOOK_PIXEL_DISPLAY_NAME='Facebook Pixel';var FULLSTORY_NAME='FULLSTORY';var FULLSTORY_DISPLAY_NAME='Fullstory';var GA_NAME='GA';var GA_DISPLAY_NAME='Google Analytics';var GA360_NAME='GA360';var GA360_DISPLAY_NAME='Google Analytics 360';var GA4_NAME='GA4';var GA4_DISPLAY_NAME='Google Analytics 4 (GA4)';var GA4_V2_NAME='GA4_V2';var GA4_V2_DISPLAY_NAME='Google Analytics 4 (GA4) V2';var GAINSIGHT_PX_NAME='GAINSIGHT_PX';var GAINSIGHT_PX_DISPLAY_NAME='Gainsight PX';var GOOGLE_OPTIMIZE_NAME='GOOGLE_OPTIMIZE';var GOOGLE_OPTIMIZE_DISPLAY_NAME='Google Optimize';var GOOGLEADS_NAME='GOOGLEADS';var GOOGLEADS_DISPLAY_NAME='Google Ads';var GTM_NAME='GTM';var GTM_DISPLAY_NAME='Google Tag Manager';var HEAP_NAME='HEAP';var HEAP_DISPLAY_NAME='Heap.io';var HOTJAR_NAME='HOTJAR';var HOTJAR_DISPLAY_NAME='Hotjar';var HS_NAME='HS';var HS_DISPLAY_NAME='HubSpot';var INTERCOM_NAME='INTERCOM';var INTERCOM_DISPLAY_NAME='Intercom';var ITERABLE_NAME='ITERABLE';var ITERABLE_DISPLAY_NAME='Iterable';var JUNE_NAME='JUNE';var JUNE_DISPLAY_NAME='JUNE';var KEEN_NAME='KEEN';var KEEN_DISPLAY_NAME='Keen';var KISSMETRICS_NAME='KISSMETRICS';var KISSMETRICS_DISPLAY_NAME='Kiss Metrics';var KLAVIYO_NAME='KLAVIYO';var KLAVIYO_DISPLAY_NAME='Klaviyo';var LAUNCHDARKLY_NAME='LAUNCHDARKLY';var LAUNCHDARKLY_DISPLAY_NAME='LaunchDarkly';var LEMNISK_NAME='LEMNISK';var LEMNISK_DISPLAY_NAME='Lemnisk Marketing Automation';var LINKEDIN_INSIGHT_TAG_NAME='LINKEDIN_INSIGHT_TAG';var LINKEDIN_INSIGHT_TAG_DISPLAY_NAME='Linkedin Insight Tag';var LIVECHAT_NAME='LIVECHAT';var LIVECHAT_DISPLAY_NAME='livechat';var LOTAME_NAME='LOTAME';var LOTAME_DISPLAY_NAME='Lotame';var LYTICS_NAME='LYTICS';var LYTICS_DISPLAY_NAME='Lytics';var MATOMO_NAME='MATOMO';var MATOMO_DISPLAY_NAME='Matomo';var MICROSOFT_CLARITY_NAME='MICROSOFT_CLARITY';var MICROSOFT_CLARITY_DISPLAY_NAME='Microsoft Clarity';var MOENGAGE_NAME='MOENGAGE';var MOENGAGE_DISPLAY_NAME='MoEngage';var MOUSEFLOW_NAME='MOUSEFLOW';var MOUSEFLOW_DISPLAY_NAME='Mouseflow';var MP_NAME='MP';var MP_DISPLAY_NAME='Mixpanel';var NINETAILED_NAME='NINETAILED';var NINETAILED_DISPLAY_NAME='Ninetailed';var OLARK_NAME='OLARK';var OLARK_DISPLAY_NAME='Olark';var OPTIMIZELY_NAME='OPTIMIZELY';var OPTIMIZELY_DISPLAY_NAME='Optimizely Web';var PENDO_NAME='PENDO';var PENDO_DISPLAY_NAME='Pendo';var PINTEREST_TAG_NAME='PINTEREST_TAG';var PINTEREST_TAG_DISPLAY_NAME='Pinterest Tag';var PODSIGHTS_NAME='PODSIGHTS';var PODSIGHTS_DISPLAY_NAME='Podsights';var POST_AFFILIATE_PRO_NAME='POST_AFFILIATE_PRO';var POST_AFFILIATE_PRO_DISPLAY_NAME='Post Affiliate Pro';var POSTHOG_NAME='POSTHOG';var POSTHOG_DISPLAY_NAME='PostHog';var PROFITWELL_NAME='PROFITWELL';var PROFITWELL_DISPLAY_NAME='ProfitWell';var QUALAROO_NAME='QUALAROO';var QUALAROO_DISPLAY_NAME='Qualaroo';var QUALTRICS_NAME='QUALTRICS';var QUALTRICS_DISPLAY_NAME='Qualtrics';var QUANTUMMETRIC_NAME='QUANTUMMETRIC';var QUANTUMMETRIC_DISPLAY_NAME='Quantum Metric';var QUORA_PIXEL_NAME='QUORA_PIXEL';var QUORA_PIXEL_DISPLAY_NAME='Quora Pixel';var REDDIT_PIXEL_NAME='REDDIT_PIXEL';var REDDIT_PIXEL_DISPLAY_NAME='Reddit Pixel';var REFINER_NAME='REFINER';var REFINER_DISPLAY_NAME='Refiner';var ROCKERBOX_NAME='ROCKERBOX';var ROCKERBOX_DISPLAY_NAME='Rockerbox';var ROLLBAR_NAME='ROLLBAR';var ROLLBAR_DISPLAY_NAME='rollbar';var SATISMETER_NAME='SATISMETER';var SATISMETER_DISPLAY_NAME='SatisMeter';var SENDINBLUE_NAME='SENDINBLUE';var SENDINBLUE_DISPLAY_NAME='Sendinblue';var SENTRY_NAME='SENTRY';var SENTRY_DISPLAY_NAME='Sentry';var SHYNET_NAME='SHYNET';var SHYNET_DISPLAY_NAME='Shynet';var SNAP_PIXEL_NAME='SNAP_PIXEL';var SNAP_PIXEL_DISPLAY_NAME='Snap Pixel';var SNAPENGAGE_NAME='SNAPENGAGE';var SNAPENGAGE_DISPLAY_NAME='SnapEngage';var SPOTIFYPIXEL_NAME='SPOTIFYPIXEL';var SPOTIFYPIXEL_DISPLAY_NAME='Spotify Pixel';var SPRIG_NAME='SPRIG';var SPRIG_DISPLAY_NAME='Sprig';var TIKTOK_ADS_NAME='TIKTOK_ADS';var TIKTOK_ADS_DISPLAY_NAME='TikTok Ads';var TVSQUARED_NAME='TVSQUARED';var TVSQUARED_DISPLAY_NAME='TVSquared';var USERPILOT_NAME='USERPILOT';var USERPILOT_DISPLAY_NAME='Userpilot';var VERO_NAME='VERO';var VERO_DISPLAY_NAME='Vero';var VWO_NAME='VWO';var VWO_DISPLAY_NAME='VWO';var WOOPRA_NAME='WOOPRA';var WOOPRA_DISPLAY_NAME='WOOPRA';var XPIXEL_NAME='XPIXEL';var XPIXEL_DISPLAY_NAME='XPixel';var YANDEX_METRICA_NAME='YANDEX_METRICA';var YANDEX_METRICA_DISPLAY_NAME='Yandex.Metrica';
|
|
1561
|
+
*/var ACTIVE_CAMPAIGN_NAME='ACTIVE_CAMPAIGN';var ACTIVE_CAMPAIGN_DISPLAY_NAME='ActiveCampaign';var ADOBE_ANALYTICS_NAME='ADOBE_ANALYTICS';var ADOBE_ANALYTICS_DISPLAY_NAME='Adobe Analytics';var ADROLL_NAME='ADROLL';var ADROLL_DISPLAY_NAME='Adroll';var AM_NAME='AM';var AM_DISPLAY_NAME='Amplitude';var APPCUES_NAME='APPCUES';var APPCUES_DISPLAY_NAME='Appcues';var AXEPTIO_NAME='AXEPTIO';var AXEPTIO_DISPLAY_NAME='Axeptio';var BINGADS_NAME='BINGADS';var BINGADS_DISPLAY_NAME='Bing Ads';var BRAZE_NAME='BRAZE';var BRAZE_DISPLAY_NAME='Braze';var BUGSNAG_NAME='BUGSNAG';var BUGSNAG_DISPLAY_NAME='Bugsnag';var CHARTBEAT_NAME='CHARTBEAT';var CHARTBEAT_DISPLAY_NAME='Chartbeat';var CLEVERTAP_NAME='CLEVERTAP';var CLEVERTAP_DISPLAY_NAME='CleverTap';var COMMANDBAR_NAME='COMMANDBAR';var COMMANDBAR_DISPLAY_NAME='CommandBar';var COMSCORE_NAME='COMSCORE';var COMSCORE_DISPLAY_NAME='Comscore';var CONVERTFLOW_NAME='CONVERTFLOW';var CONVERTFLOW_DISPLAY_NAME='Convertflow';var CRITEO_NAME='CRITEO';var CRITEO_DISPLAY_NAME='Criteo';var CUSTOMERIO_NAME='CUSTOMERIO';var CUSTOMERIO_DISPLAY_NAME='Customer IO';var DCM_FLOODLIGHT_NAME='DCM_FLOODLIGHT';var DCM_FLOODLIGHT_DISPLAY_NAME='DCM Floodlight';var DRIP_NAME='DRIP';var DRIP_DISPLAY_NAME='Drip';var ENGAGE_NAME='ENGAGE';var ENGAGE_DISPLAY_NAME='Engage';var FACEBOOK_PIXEL_NAME='FACEBOOK_PIXEL';var FACEBOOK_PIXEL_DISPLAY_NAME='Facebook Pixel';var FULLSTORY_NAME='FULLSTORY';var FULLSTORY_DISPLAY_NAME='Fullstory';var GA_NAME='GA';var GA_DISPLAY_NAME='Google Analytics';var GA360_NAME='GA360';var GA360_DISPLAY_NAME='Google Analytics 360';var GA4_NAME='GA4';var GA4_DISPLAY_NAME='Google Analytics 4 (GA4)';var GA4_V2_NAME='GA4_V2';var GA4_V2_DISPLAY_NAME='Google Analytics 4 (GA4) V2';var GAINSIGHT_PX_NAME='GAINSIGHT_PX';var GAINSIGHT_PX_DISPLAY_NAME='Gainsight PX';var GOOGLE_OPTIMIZE_NAME='GOOGLE_OPTIMIZE';var GOOGLE_OPTIMIZE_DISPLAY_NAME='Google Optimize';var GOOGLEADS_NAME='GOOGLEADS';var GOOGLEADS_DISPLAY_NAME='Google Ads';var GTM_NAME='GTM';var GTM_DISPLAY_NAME='Google Tag Manager';var HEAP_NAME='HEAP';var HEAP_DISPLAY_NAME='Heap.io';var HOTJAR_NAME='HOTJAR';var HOTJAR_DISPLAY_NAME='Hotjar';var HS_NAME='HS';var HS_DISPLAY_NAME='HubSpot';var INTERCOM_NAME='INTERCOM';var INTERCOM_DISPLAY_NAME='Intercom';var ITERABLE_NAME='ITERABLE';var ITERABLE_DISPLAY_NAME='Iterable';var JUNE_NAME='JUNE';var JUNE_DISPLAY_NAME='JUNE';var KEEN_NAME='KEEN';var KEEN_DISPLAY_NAME='Keen';var KISSMETRICS_NAME='KISSMETRICS';var KISSMETRICS_DISPLAY_NAME='Kiss Metrics';var KLAVIYO_NAME='KLAVIYO';var KLAVIYO_DISPLAY_NAME='Klaviyo';var LAUNCHDARKLY_NAME='LAUNCHDARKLY';var LAUNCHDARKLY_DISPLAY_NAME='LaunchDarkly';var LEMNISK_NAME='LEMNISK';var LEMNISK_DISPLAY_NAME='Lemnisk Marketing Automation';var LINKEDIN_INSIGHT_TAG_NAME='LINKEDIN_INSIGHT_TAG';var LINKEDIN_INSIGHT_TAG_DISPLAY_NAME='Linkedin Insight Tag';var LIVECHAT_NAME='LIVECHAT';var LIVECHAT_DISPLAY_NAME='livechat';var LOTAME_NAME='LOTAME';var LOTAME_DISPLAY_NAME='Lotame';var LYTICS_NAME='LYTICS';var LYTICS_DISPLAY_NAME='Lytics';var MATOMO_NAME='MATOMO';var MATOMO_DISPLAY_NAME='Matomo';var MICROSOFT_CLARITY_NAME='MICROSOFT_CLARITY';var MICROSOFT_CLARITY_DISPLAY_NAME='Microsoft Clarity';var MOENGAGE_NAME='MOENGAGE';var MOENGAGE_DISPLAY_NAME='MoEngage';var MOUSEFLOW_NAME='MOUSEFLOW';var MOUSEFLOW_DISPLAY_NAME='Mouseflow';var MP_NAME='MP';var MP_DISPLAY_NAME='Mixpanel';var NINETAILED_NAME='NINETAILED';var NINETAILED_DISPLAY_NAME='Ninetailed';var OLARK_NAME='OLARK';var OLARK_DISPLAY_NAME='Olark';var OPENAI_ADS_DISPLAY_NAME='OpenAI Ads';var OPTIMIZELY_NAME='OPTIMIZELY';var OPTIMIZELY_DISPLAY_NAME='Optimizely Web';var PENDO_NAME='PENDO';var PENDO_DISPLAY_NAME='Pendo';var PINTEREST_TAG_NAME='PINTEREST_TAG';var PINTEREST_TAG_DISPLAY_NAME='Pinterest Tag';var PODSIGHTS_NAME='PODSIGHTS';var PODSIGHTS_DISPLAY_NAME='Podsights';var POST_AFFILIATE_PRO_NAME='POST_AFFILIATE_PRO';var POST_AFFILIATE_PRO_DISPLAY_NAME='Post Affiliate Pro';var POSTHOG_NAME='POSTHOG';var POSTHOG_DISPLAY_NAME='PostHog';var PROFITWELL_NAME='PROFITWELL';var PROFITWELL_DISPLAY_NAME='ProfitWell';var QUALAROO_NAME='QUALAROO';var QUALAROO_DISPLAY_NAME='Qualaroo';var QUALTRICS_NAME='QUALTRICS';var QUALTRICS_DISPLAY_NAME='Qualtrics';var QUANTUMMETRIC_NAME='QUANTUMMETRIC';var QUANTUMMETRIC_DISPLAY_NAME='Quantum Metric';var QUORA_PIXEL_NAME='QUORA_PIXEL';var QUORA_PIXEL_DISPLAY_NAME='Quora Pixel';var REDDIT_PIXEL_NAME='REDDIT_PIXEL';var REDDIT_PIXEL_DISPLAY_NAME='Reddit Pixel';var REFINER_NAME='REFINER';var REFINER_DISPLAY_NAME='Refiner';var ROCKERBOX_NAME='ROCKERBOX';var ROCKERBOX_DISPLAY_NAME='Rockerbox';var ROLLBAR_NAME='ROLLBAR';var ROLLBAR_DISPLAY_NAME='rollbar';var SATISMETER_NAME='SATISMETER';var SATISMETER_DISPLAY_NAME='SatisMeter';var SENDINBLUE_NAME='SENDINBLUE';var SENDINBLUE_DISPLAY_NAME='Sendinblue';var SENTRY_NAME='SENTRY';var SENTRY_DISPLAY_NAME='Sentry';var SHYNET_NAME='SHYNET';var SHYNET_DISPLAY_NAME='Shynet';var SNAP_PIXEL_NAME='SNAP_PIXEL';var SNAP_PIXEL_DISPLAY_NAME='Snap Pixel';var SNAPENGAGE_NAME='SNAPENGAGE';var SNAPENGAGE_DISPLAY_NAME='SnapEngage';var SPOTIFYPIXEL_NAME='SPOTIFYPIXEL';var SPOTIFYPIXEL_DISPLAY_NAME='Spotify Pixel';var SPRIG_NAME='SPRIG';var SPRIG_DISPLAY_NAME='Sprig';var TIKTOK_ADS_NAME='TIKTOK_ADS';var TIKTOK_ADS_DISPLAY_NAME='TikTok Ads';var TVSQUARED_NAME='TVSQUARED';var TVSQUARED_DISPLAY_NAME='TVSquared';var USERPILOT_NAME='USERPILOT';var USERPILOT_DISPLAY_NAME='Userpilot';var VERO_NAME='VERO';var VERO_DISPLAY_NAME='Vero';var VWO_NAME='VWO';var VWO_DISPLAY_NAME='VWO';var WOOPRA_NAME='WOOPRA';var WOOPRA_DISPLAY_NAME='WOOPRA';var XPIXEL_NAME='XPIXEL';var XPIXEL_DISPLAY_NAME='XPixel';var YANDEX_METRICA_NAME='YANDEX_METRICA';var YANDEX_METRICA_DISPLAY_NAME='Yandex.Metrica';
|
|
1562
|
+
|
|
1563
|
+
var DIR_NAME$1i='HubSpot';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},HS_NAME,HS_NAME),"Hubspot",HS_NAME),"HUBSPOT",HS_NAME),'hub spot',HS_NAME),'Hub Spot',HS_NAME),'Hub spot',HS_NAME);
|
|
1549
1564
|
|
|
1550
|
-
var DIR_NAME$1h='
|
|
1565
|
+
var DIR_NAME$1h='GA';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},GA_NAME,GA_NAME),'Google Analytics',GA_NAME),"GoogleAnalytics",GA_NAME),'GOOGLE ANALYTICS',GA_NAME),'google analytics',GA_NAME);
|
|
1551
1566
|
|
|
1552
|
-
var DIR_NAME$1g='
|
|
1567
|
+
var DIR_NAME$1g='Hotjar';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},HOTJAR_NAME,HOTJAR_NAME),"Hotjar",HOTJAR_NAME),"hotjar",HOTJAR_NAME),'Hot Jar',HOTJAR_NAME),'hot jar',HOTJAR_NAME);
|
|
1553
1568
|
|
|
1554
|
-
var DIR_NAME$1f='
|
|
1569
|
+
var DIR_NAME$1f='GoogleAds';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},GOOGLEADS_NAME,GOOGLEADS_NAME),'Google Ads',GOOGLEADS_NAME),"GoogleAds",GOOGLEADS_NAME),'GOOGLE ADS',GOOGLEADS_NAME),'google ads',GOOGLEADS_NAME),"googleads",GOOGLEADS_NAME);
|
|
1555
1570
|
|
|
1556
|
-
var DIR_NAME$1e='
|
|
1571
|
+
var DIR_NAME$1e='VWO';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},VWO_NAME,VWO_NAME),"VisualWebsiteOptimizer",VWO_NAME),"Visualwebsiteoptimizer",VWO_NAME),"visualwebsiteoptimizer",VWO_NAME),"vwo",VWO_NAME),'Visual Website Optimizer',VWO_NAME),'Visual website optimizer',VWO_NAME),'visual website optimizer',VWO_NAME);
|
|
1557
1572
|
|
|
1558
|
-
var DIR_NAME$1d='
|
|
1573
|
+
var DIR_NAME$1d='GoogleTagManager';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},GTM_NAME,GTM_NAME),'Google Tag Manager',GTM_NAME),'google tag manager',GTM_NAME),'googletag manager',GTM_NAME),"googletagmanager",GTM_NAME);
|
|
1559
1574
|
|
|
1560
|
-
var DIR_NAME$1c='
|
|
1575
|
+
var DIR_NAME$1c='Braze';_defineProperty(_defineProperty(_defineProperty({},BRAZE_NAME,BRAZE_NAME),"Braze",BRAZE_NAME),"braze",BRAZE_NAME);
|
|
1561
1576
|
|
|
1562
|
-
var DIR_NAME$1b='
|
|
1577
|
+
var DIR_NAME$1b='INTERCOM';_defineProperty(_defineProperty(_defineProperty({},INTERCOM_NAME,INTERCOM_NAME),"Intercom",INTERCOM_NAME),"intercom",INTERCOM_NAME);
|
|
1563
1578
|
|
|
1564
|
-
var DIR_NAME$1a='
|
|
1579
|
+
var DIR_NAME$1a='Keen';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},KEEN_NAME,KEEN_NAME),"Keen",KEEN_NAME),'Keen.io',KEEN_NAME),"keen",KEEN_NAME),'keen.io',KEEN_NAME);
|
|
1565
1580
|
|
|
1566
|
-
var DIR_NAME$19='
|
|
1581
|
+
var DIR_NAME$19='Kissmetrics';_defineProperty(_defineProperty(_defineProperty({},KISSMETRICS_NAME,KISSMETRICS_NAME),"Kissmetrics",KISSMETRICS_NAME),"kissmetrics",KISSMETRICS_NAME);
|
|
1567
1582
|
|
|
1568
|
-
var DIR_NAME$18='
|
|
1583
|
+
var DIR_NAME$18='CustomerIO';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},CUSTOMERIO_NAME,CUSTOMERIO_NAME),"Customerio",CUSTOMERIO_NAME),'Customer.io',CUSTOMERIO_NAME),'CUSTOMER.IO',CUSTOMERIO_NAME),'customer.io',CUSTOMERIO_NAME);
|
|
1569
1584
|
|
|
1570
|
-
var DIR_NAME$17='
|
|
1585
|
+
var DIR_NAME$17='Chartbeat';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},CHARTBEAT_NAME,CHARTBEAT_NAME),"Chartbeat",CHARTBEAT_NAME),"chartbeat",CHARTBEAT_NAME),'Chart Beat',CHARTBEAT_NAME),'chart beat',CHARTBEAT_NAME);
|
|
1571
1586
|
|
|
1572
|
-
var DIR_NAME$16='
|
|
1587
|
+
var DIR_NAME$16='FacebookPixel';_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},FACEBOOK_PIXEL_NAME,FACEBOOK_PIXEL_NAME),'FB Pixel',FACEBOOK_PIXEL_NAME),'Facebook Pixel',FACEBOOK_PIXEL_NAME),'facebook pixel',FACEBOOK_PIXEL_NAME),"fbpixel",FACEBOOK_PIXEL_NAME),"FBPIXEL",FACEBOOK_PIXEL_NAME),"FB_PIXEL",FACEBOOK_PIXEL_NAME);
|
|
1573
1588
|
|
|
1574
|
-
var DIR_NAME$15='
|
|
1589
|
+
var DIR_NAME$15='Lotame';_defineProperty(_defineProperty(_defineProperty({},LOTAME_NAME,LOTAME_NAME),"Lotame",LOTAME_NAME),"lotame",LOTAME_NAME);
|
|
1575
1590
|
|
|
1576
|
-
var DIR_NAME$14='
|
|
1591
|
+
var DIR_NAME$14='Optimizely';_defineProperty(_defineProperty(_defineProperty({},OPTIMIZELY_NAME,OPTIMIZELY_NAME),"Optimizely",OPTIMIZELY_NAME),"optimizely",OPTIMIZELY_NAME);
|
|
1577
1592
|
|
|
1578
|
-
var DIR_NAME$13='
|
|
1593
|
+
var DIR_NAME$13='OpenAIAds';
|
|
1579
1594
|
|
|
1580
1595
|
var DIR_NAME$12='Bugsnag';_defineProperty(_defineProperty(_defineProperty({},BUGSNAG_NAME,BUGSNAG_NAME),"bugsnag",BUGSNAG_NAME),"Bugsnag",BUGSNAG_NAME);
|
|
1581
1596
|
|
|
@@ -1712,7 +1727,7 @@ var DIR_NAME$1='Userpilot';_defineProperty(_defineProperty(_defineProperty({},US
|
|
|
1712
1727
|
var DIR_NAME='Comscore';_defineProperty({},COMSCORE_DISPLAY_NAME,DIR_NAME);_defineProperty(_defineProperty(_defineProperty(_defineProperty({},COMSCORE_NAME,COMSCORE_NAME),"Comscore",COMSCORE_NAME),"comscore",COMSCORE_NAME),"comScore",COMSCORE_NAME);
|
|
1713
1728
|
|
|
1714
1729
|
var _destDisplayNamesToFi;// map of the destination display names to the destination directory names
|
|
1715
|
-
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,HS_DISPLAY_NAME,DIR_NAME$
|
|
1730
|
+
var destDisplayNamesToFileNamesMap=(_destDisplayNamesToFi={},_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,HS_DISPLAY_NAME,DIR_NAME$1i),GA_DISPLAY_NAME,DIR_NAME$1h),HOTJAR_DISPLAY_NAME,DIR_NAME$1g),GOOGLEADS_DISPLAY_NAME,DIR_NAME$1f),VWO_DISPLAY_NAME,DIR_NAME$1e),GTM_DISPLAY_NAME,DIR_NAME$1d),BRAZE_DISPLAY_NAME,DIR_NAME$1c),INTERCOM_DISPLAY_NAME,DIR_NAME$1b),KEEN_DISPLAY_NAME,DIR_NAME$1a),KISSMETRICS_DISPLAY_NAME,DIR_NAME$19),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,CUSTOMERIO_DISPLAY_NAME,DIR_NAME$18),CHARTBEAT_DISPLAY_NAME,DIR_NAME$17),FACEBOOK_PIXEL_DISPLAY_NAME,DIR_NAME$16),LOTAME_DISPLAY_NAME,DIR_NAME$15),OPTIMIZELY_DISPLAY_NAME,DIR_NAME$14),OPENAI_ADS_DISPLAY_NAME,DIR_NAME$13),BUGSNAG_DISPLAY_NAME,DIR_NAME$12),FULLSTORY_DISPLAY_NAME,DIR_NAME$11),TVSQUARED_DISPLAY_NAME,DIR_NAME$10),GA4_DISPLAY_NAME,DIR_NAME$$),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,GA4_V2_DISPLAY_NAME,DIR_NAME$_),MOENGAGE_DISPLAY_NAME,DIR_NAME$Z),AM_DISPLAY_NAME,DIR_NAME$Y),PENDO_DISPLAY_NAME,DIR_NAME$X),LYTICS_DISPLAY_NAME,DIR_NAME$W),APPCUES_DISPLAY_NAME,DIR_NAME$V),POSTHOG_DISPLAY_NAME,DIR_NAME$U),KLAVIYO_DISPLAY_NAME,DIR_NAME$T),CLEVERTAP_DISPLAY_NAME,DIR_NAME$S),BINGADS_DISPLAY_NAME,DIR_NAME$R),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,PINTEREST_TAG_DISPLAY_NAME,DIR_NAME$Q),ADOBE_ANALYTICS_DISPLAY_NAME,DIR_NAME$P),LINKEDIN_INSIGHT_TAG_DISPLAY_NAME,DIR_NAME$O),REDDIT_PIXEL_DISPLAY_NAME,DIR_NAME$N),DRIP_DISPLAY_NAME,DIR_NAME$M),HEAP_DISPLAY_NAME,DIR_NAME$L),CRITEO_DISPLAY_NAME,DIR_NAME$K),MP_DISPLAY_NAME,DIR_NAME$J),QUALTRICS_DISPLAY_NAME,DIR_NAME$I),PROFITWELL_DISPLAY_NAME,DIR_NAME$H),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,SENTRY_DISPLAY_NAME,DIR_NAME$G),QUANTUMMETRIC_DISPLAY_NAME,DIR_NAME$F),SNAP_PIXEL_DISPLAY_NAME,DIR_NAME$E),POST_AFFILIATE_PRO_DISPLAY_NAME,DIR_NAME$D),GOOGLE_OPTIMIZE_DISPLAY_NAME,DIR_NAME$C),LAUNCHDARKLY_DISPLAY_NAME,DIR_NAME$B),GA360_DISPLAY_NAME,DIR_NAME$A),ADROLL_DISPLAY_NAME,DIR_NAME$z),DCM_FLOODLIGHT_DISPLAY_NAME,DIR_NAME$y),MATOMO_DISPLAY_NAME,DIR_NAME$x),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,VERO_DISPLAY_NAME,DIR_NAME$w),MOUSEFLOW_DISPLAY_NAME,DIR_NAME$v),ROCKERBOX_DISPLAY_NAME,DIR_NAME$u),CONVERTFLOW_DISPLAY_NAME,DIR_NAME$t),SNAPENGAGE_DISPLAY_NAME,DIR_NAME$s),LIVECHAT_DISPLAY_NAME,DIR_NAME$r),SHYNET_DISPLAY_NAME,DIR_NAME$q),WOOPRA_DISPLAY_NAME,DIR_NAME$p),ROLLBAR_DISPLAY_NAME,DIR_NAME$o),QUORA_PIXEL_DISPLAY_NAME,DIR_NAME$n),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,JUNE_DISPLAY_NAME,DIR_NAME$m),ENGAGE_DISPLAY_NAME,DIR_NAME$l),ITERABLE_DISPLAY_NAME,DIR_NAME$k),YANDEX_METRICA_DISPLAY_NAME,DIR_NAME$j),REFINER_DISPLAY_NAME,DIR_NAME$i),QUALAROO_DISPLAY_NAME,DIR_NAME$h),PODSIGHTS_DISPLAY_NAME,DIR_NAME$g),AXEPTIO_DISPLAY_NAME,DIR_NAME$f),SATISMETER_DISPLAY_NAME,DIR_NAME$e),MICROSOFT_CLARITY_DISPLAY_NAME,DIR_NAME$d),_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,SENDINBLUE_DISPLAY_NAME,DIR_NAME$c),OLARK_DISPLAY_NAME,DIR_NAME$b),LEMNISK_DISPLAY_NAME,DIR_NAME$a),TIKTOK_ADS_DISPLAY_NAME,DIR_NAME$9),ACTIVE_CAMPAIGN_DISPLAY_NAME,DIR_NAME$8),SPRIG_DISPLAY_NAME,DIR_NAME$7),SPOTIFYPIXEL_DISPLAY_NAME,DIR_NAME$6),COMMANDBAR_DISPLAY_NAME,DIR_NAME$5),NINETAILED_DISPLAY_NAME,DIR_NAME$4),GAINSIGHT_PX_DISPLAY_NAME,DIR_NAME$3),_defineProperty(_defineProperty(_defineProperty(_destDisplayNamesToFi,XPIXEL_DISPLAY_NAME,DIR_NAME$2),USERPILOT_DISPLAY_NAME,DIR_NAME$1),COMSCORE_DISPLAY_NAME,DIR_NAME));
|
|
1716
1731
|
|
|
1717
1732
|
/**
|
|
1718
1733
|
* Determines if the destination SDK code is evaluated
|
|
@@ -1801,9 +1816,9 @@ state.nativeDestinations.activeDestinations.value=[].concat(_toConsumableArray(s
|
|
|
1801
1816
|
var sdkTypeName=sdkName;if(sdkTypeName&&!isDestinationSDKMounted(destSDKIdentifier,sdkTypeName)){var destSdkURL="".concat(integrationsCDNPath,"/").concat(sdkName,".min.js");externalSrcLoader.loadJSFile({url:destSdkURL,id:dest.userFriendlyId,callback:externalScriptOnLoad!==null&&externalScriptOnLoad!==void 0?externalScriptOnLoad:function(id,err){if(err){var customMessage=INTEGRATION_SDK_LOAD_ERROR(dest.displayName);errorHandler===null||errorHandler===void 0||errorHandler.onError({error:err,context:DEVICE_MODE_DESTINATIONS_PLUGIN,customMessage:customMessage,groupingHash:customMessage,category:INTEGRATIONS_ERROR_CATEGORY});state.nativeDestinations.failedDestinations.value=[].concat(_toConsumableArray(state.nativeDestinations.failedDestinations.value),[dest]);}else {initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler);}},timeout:SCRIPT_LOAD_TIMEOUT_MS});}else {initializeDestination(dest,state,destSDKIdentifier,sdkTypeName,errorHandler);}});}}};};
|
|
1802
1817
|
|
|
1803
1818
|
var DEFAULT_TRANSFORMATION_QUEUE_OPTIONS={minRetryDelay:500,backoffFactor:2,maxAttempts:3};var REQUEST_TIMEOUT_MS$1=10*1000;// 10 seconds
|
|
1804
|
-
var QUEUE_NAME$2='
|
|
1819
|
+
var QUEUE_NAME$2='rudder_dmt';var DMT_PLUGIN='DeviceModeTransformationPlugin';
|
|
1805
1820
|
|
|
1806
|
-
var DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR=function DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(context,displayName,id,reason,action){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Event transformation unsuccessful for destination \"").concat(displayName,"\" with id \"").concat(id,"\". Reason: ").concat(reason,". ").concat(action,".");};var DMT_REQUEST_FAILED_ERROR=function DMT_REQUEST_FAILED_ERROR(context,displayName,id,status,action){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"[Destination: ").concat(displayName," with id \"").concat(id,"\"].Transformation request failed with status: ").concat(status,". Retries exhausted. ").concat(action,".");};var DMT_EXCEPTION=function DMT_EXCEPTION(displayName,id){return "Transformation failed for destination \"".concat(displayName,"\" with id \"").concat(id,"\"");};var DMT_SERVER_ACCESS_DENIED_WARNING=function DMT_SERVER_ACCESS_DENIED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination.");};
|
|
1821
|
+
var DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR=function DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(context,displayName,id,reason,action){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Event transformation unsuccessful for destination \"").concat(displayName,"\" with id \"").concat(id,"\". Reason: ").concat(reason,". ").concat(action,".");};var DMT_REQUEST_FAILED_ERROR=function DMT_REQUEST_FAILED_ERROR(context,displayName,id,status,action){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"[Destination: ").concat(displayName," with id \"").concat(id,"\"].Transformation request failed with status: ").concat(status,". Retries exhausted. ").concat(action,".");};var DMT_EXCEPTION=function DMT_EXCEPTION(displayName,id){return "Transformation failed for destination \"".concat(displayName,"\" with id \"").concat(id,"\"");};var DMT_SERVER_ACCESS_DENIED_WARNING=function DMT_SERVER_ACCESS_DENIED_WARNING(context){return "".concat(context).concat(LOG_CONTEXT_SEPARATOR,"Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination.");};var DMT_INVALID_DESTINATION_IDS_ERROR=function DMT_INVALID_DESTINATION_IDS_ERROR(action){return "Invalid destination IDs in the queue item. ".concat(action,".");};
|
|
1807
1822
|
|
|
1808
1823
|
/**
|
|
1809
1824
|
* A helper function that will take rudderEvent and generate
|
|
@@ -1813,7 +1828,9 @@ var DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR=function DMT_TRANSFORMATION_UNSUCCESSF
|
|
|
1813
1828
|
* Helper function to get destination identifier consistently
|
|
1814
1829
|
*/var getDestinationId=function getDestinationId(dest){var _dest$originalId;return (_dest$originalId=dest.originalId)!==null&&_dest$originalId!==void 0?_dest$originalId:dest.id;};/**
|
|
1815
1830
|
* Helper function to log once per destination to avoid duplicate messages
|
|
1816
|
-
*/var logOncePerDestination=function logOncePerDestination(destinationId,loggedDestinations,logFn){if(!loggedDestinations.includes(destinationId)){loggedDestinations.push(destinationId);logFn();}};var sendTransformedEventToDestinations=function sendTransformedEventToDestinations(state,pluginsManager,destinationIds,result,status,event,errorHandler,logger){var NATIVE_DEST_EXT_POINT='destinationsEventsQueue.enqueueEventToDestination';var ACTION_TO_SEND_UNTRANSFORMED_EVENT='Sending untransformed event';var ACTION_TO_DROP_EVENT='Dropping the event'
|
|
1831
|
+
*/var logOncePerDestination=function logOncePerDestination(destinationId,loggedDestinations,logFn){if(!loggedDestinations.includes(destinationId)){loggedDestinations.push(destinationId);logFn();}};var sendTransformedEventToDestinations=function sendTransformedEventToDestinations(state,pluginsManager,destinationIds,result,status,event,errorHandler,logger){var NATIVE_DEST_EXT_POINT='destinationsEventsQueue.enqueueEventToDestination';var ACTION_TO_SEND_UNTRANSFORMED_EVENT='Sending untransformed event';var ACTION_TO_DROP_EVENT='Dropping the event';// Items that don't carry destination IDs don't belong to this queue
|
|
1832
|
+
// and cannot be delivered to any destination
|
|
1833
|
+
if(!Array.isArray(destinationIds)){var errMessage=DMT_INVALID_DESTINATION_IDS_ERROR(ACTION_TO_DROP_EVENT);errorHandler===null||errorHandler===void 0||errorHandler.onError({error:new Error(errMessage),context:DMT_PLUGIN,customMessage:errMessage});return;}var destinations=state.nativeDestinations.initializedDestinations.value.filter(function(d){return d&&destinationIds.includes(getDestinationId(d));});var loggedDestinations=[];destinations.forEach(function(dest){try{var eventsToSend=[];var destinationId=getDestinationId(dest);switch(status){case 200:{var response=JSON.parse(result);var destTransformedResult=response.transformedBatch.find(function(e){return e.id===destinationId;});destTransformedResult===null||destTransformedResult===void 0||destTransformedResult.payload.forEach(function(tEvent){if(tEvent.status==='200'){eventsToSend.push(tEvent.event);}else {var reason='Unknown';if(tEvent.status==='410'){reason='Transformation is not available';}var action=ACTION_TO_DROP_EVENT;if(dest.propagateEventsUntransformedOnError===true){action=ACTION_TO_SEND_UNTRANSFORMED_EVENT;eventsToSend.push(event);logOncePerDestination(destinationId,loggedDestinations,function(){logger===null||logger===void 0||logger.warn(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,destinationId,reason,action));});}else {logOncePerDestination(destinationId,loggedDestinations,function(){logger===null||logger===void 0||logger.error(DMT_TRANSFORMATION_UNSUCCESSFUL_ERROR(DMT_PLUGIN,dest.displayName,destinationId,reason,action));});}}});break;}// Transformation server access denied
|
|
1817
1834
|
case 404:{logOncePerDestination(destinationId,loggedDestinations,function(){logger===null||logger===void 0||logger.warn(DMT_SERVER_ACCESS_DENIED_WARNING(DMT_PLUGIN));});eventsToSend.push(event);break;}default:{if(dest.propagateEventsUntransformedOnError===true){logOncePerDestination(destinationId,loggedDestinations,function(){logger===null||logger===void 0||logger.warn(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,destinationId,status,ACTION_TO_SEND_UNTRANSFORMED_EVENT));});eventsToSend.push(event);}else {logOncePerDestination(destinationId,loggedDestinations,function(){logger===null||logger===void 0||logger.error(DMT_REQUEST_FAILED_ERROR(DMT_PLUGIN,dest.displayName,destinationId,status,ACTION_TO_DROP_EVENT));});}break;}}eventsToSend===null||eventsToSend===void 0||eventsToSend.forEach(function(tEvent){if(isNonEmptyObject(tEvent)){pluginsManager.invokeSingle(NATIVE_DEST_EXT_POINT,state,tEvent,dest,errorHandler,logger);}});}catch(err){errorHandler===null||errorHandler===void 0||errorHandler.onError({error:err,context:DMT_PLUGIN,customMessage:DMT_EXCEPTION(dest.displayName,dest.id)});}});};
|
|
1818
1835
|
|
|
1819
1836
|
var pluginName$a='DeviceModeTransformation';var DeviceModeTransformation=function DeviceModeTransformation(){return {name:pluginName$a,deps:[],initialize:function initialize(state){state.plugins.loadedPlugins.value=[].concat(_toConsumableArray(state.plugins.loadedPlugins.value),[pluginName$a]);},transformEvent:{init:function init(state,pluginsManager,httpClient,storeManager,errorHandler,logger){var writeKey=state.lifecycle.writeKey.value;httpClient.setAuthHeader(writeKey);var eventsQueue=new RetryQueue(// adding write key to the queue name to avoid conflicts
|
|
@@ -3293,20 +3310,29 @@ state.storage.cookie.value={maxage:cookieStorageOptions.maxage,path:cookieStorag
|
|
|
3293
3310
|
|
|
3294
3311
|
/**
|
|
3295
3312
|
* Store Implementation with dedicated storage
|
|
3296
|
-
*/var Store=/*#__PURE__*/function(){function Store(config,engine,pluginsManager){var _config$isEncrypted,_config$validKeys;_classCallCheck(this,Store);this.id=config.id;this.name=config.name;this.isEncrypted=(_config$isEncrypted=config.isEncrypted)!==null&&_config$isEncrypted!==void 0?_config$isEncrypted:false;this.validKeys=(_config$validKeys=config.validKeys)!==null&&_config$validKeys!==void 0?_config$validKeys:{};this.engine=engine;this.noKeyValidation=Object.keys(this.validKeys).length===0;this.noCompoundKey=config.noCompoundKey;this.originalEngine=this.engine;this.errorHandler=config.errorHandler;this.logger=config.logger;this.pluginsManager=pluginsManager;}/**
|
|
3313
|
+
*/var Store=/*#__PURE__*/function(){function Store(config,engine,pluginsManager){var _config$isEncrypted,_config$validKeys;_classCallCheck(this,Store);this.id=config.id;this.name=config.name;this.isEncrypted=(_config$isEncrypted=config.isEncrypted)!==null&&_config$isEncrypted!==void 0?_config$isEncrypted:false;this.validKeys=(_config$validKeys=config.validKeys)!==null&&_config$validKeys!==void 0?_config$validKeys:{};this.engine=engine;this.noKeyValidation=Object.keys(this.validKeys).length===0;this.noCompoundKey=config.noCompoundKey;this.noSwapOnQuota=config.noSwapOnQuota;this.originalEngine=this.engine;this.errorHandler=config.errorHandler;this.logger=config.logger;this.pluginsManager=pluginsManager;}/**
|
|
3297
3314
|
* Ensure the key is valid and with correct format
|
|
3298
3315
|
*/return _createClass(Store,[{key:"createValidKey",value:function createValidKey(key){var name=this.name,id=this.id,validKeys=this.validKeys,noKeyValidation=this.noKeyValidation,noCompoundKey=this.noCompoundKey;if(noKeyValidation){return noCompoundKey?key:[name,id,key].join('.');}// validate and return undefined if invalid key
|
|
3299
3316
|
var compoundKey;Object.values(validKeys).forEach(function(validKeyName){if(validKeyName===key){compoundKey=noCompoundKey?key:[name,id,key].join('.');}});return compoundKey;}/**
|
|
3300
3317
|
* Switch to inMemoryEngine, bringing any existing data with.
|
|
3301
|
-
*/},{key:"swapQueueStoreToInMemoryEngine",value:function swapQueueStoreToInMemoryEngine(){var _this=this;var
|
|
3318
|
+
*/},{key:"swapQueueStoreToInMemoryEngine",value:function swapQueueStoreToInMemoryEngine(){var _this=this;var validKeys=this.validKeys,noCompoundKey=this.noCompoundKey;var inMemoryStorage=getStorageEngine(MEMORY_STORAGE);var durableEngine=this.engine;// grab existing data, but only for this page's queue instance, not all
|
|
3302
3319
|
// better to keep other queues in localstorage to be flushed later
|
|
3303
3320
|
// than to pull them into memory and remove them from durable storage
|
|
3304
|
-
Object.
|
|
3305
|
-
//
|
|
3306
|
-
|
|
3321
|
+
var existingEntries=Object.values(validKeys).map(function(storeKey){return [storeKey,_this.get(storeKey)];});// Client data stores keep their durable copy. Dropping rl_user_id and the
|
|
3322
|
+
// other cookie keys here would lose the identity on the next page load.
|
|
3323
|
+
var canDropDurableCopy=!noCompoundKey&&durableEngine!==inMemoryStorage;this.engine=inMemoryStorage;existingEntries.forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),storeKey=_ref2[0],value=_ref2[1];if(isNullOrUndefined(value)){return;}// Write through set() so the values are serialised and keyed exactly as
|
|
3324
|
+
// every later read expects them.
|
|
3325
|
+
_this.set(storeKey,value);// Only give up the durable copy once the value is readable from memory:
|
|
3326
|
+
// set() swallows serialisation and storage failures, and get() returns
|
|
3327
|
+
// null on a parse or decryption failure.
|
|
3328
|
+
var validKey=_this.createValidKey(storeKey);if(canDropDurableCopy&&validKey&&!isNullOrUndefined(_this.get(storeKey))){try{durableEngine.removeItem(validKey);}catch(_unused){// The durable engine can refuse a removal (NS_ERROR_STORAGE_BUSY). The
|
|
3329
|
+
// value is already safe in memory, so leave the stale copy for a later
|
|
3330
|
+
// cleanup rather than aborting the migration - this runs inside set()'s
|
|
3331
|
+
// catch, and throwing here would lose the value that triggered it.
|
|
3332
|
+
}}});}/**
|
|
3307
3333
|
* Set value by key.
|
|
3308
3334
|
*/},{key:"set",value:function set(key,value){var validKey=this.createValidKey(key);if(!validKey){return;}try{// storejs that is used in localstorage engine already stringifies json
|
|
3309
|
-
this.engine.setItem(validKey,this.encrypt(stringifyWithoutCircular(value,false,[],this.logger)));}catch(err){if(isStorageQuotaExceeded(err)){this.logger.warn(STORAGE_QUOTA_EXCEEDED_WARNING("Store ".concat(this.id)))
|
|
3335
|
+
this.engine.setItem(validKey,this.encrypt(stringifyWithoutCircular(value,false,[],this.logger)));}catch(err){if(isStorageQuotaExceeded(err)){this.logger.warn(STORAGE_QUOTA_EXCEEDED_WARNING("Store ".concat(this.id)));if(this.noSwapOnQuota){return;}// switch to inMemory engine
|
|
3310
3336
|
this.swapQueueStoreToInMemoryEngine();// and save it there
|
|
3311
3337
|
this.set(key,value);}else {var customMessage=STORE_DATA_SAVE_ERROR(key);this.onError(err,customMessage,customMessage);}}}/**
|
|
3312
3338
|
* Get by Key.
|
|
@@ -3358,19 +3384,31 @@ var isValidSourceConfig=function isValidSourceConfig(res){return isObjectLiteral
|
|
|
3358
3384
|
* @param storageOpts Storage options from the load API options or the consent API options
|
|
3359
3385
|
* @param context Logger context
|
|
3360
3386
|
* @param logger Logger instance
|
|
3361
|
-
*/var validateStorageOptions=function validateStorageOptions(storageOpts,context,logger){if(!isObjectLiteralAndNotNull(storageOpts)){return;}var type=storageOpts.type,entries=storageOpts.entries;if(isDefined(type)&&!isValidStorageType(type)){logger===null||logger===void 0||logger.warn(STORAGE_TYPE_VALIDATION_WARNING(context,type));}if(entries){Object.entries(entries).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),entryKey=_ref2[0],entryOpts=_ref2[1];var entryType=entryOpts===null||entryOpts===void 0?void 0:entryOpts.type;if(isDefined(entryType)&&!isValidStorageType(entryType)){logger===null||logger===void 0||logger.warn(UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entryKey,entryType));}});}}
|
|
3362
|
-
|
|
3363
|
-
|
|
3387
|
+
*/var validateStorageOptions=function validateStorageOptions(storageOpts,context,logger){if(!isObjectLiteralAndNotNull(storageOpts)){return;}var type=storageOpts.type,entries=storageOpts.entries;if(isDefined(type)&&!isValidStorageType(type)){logger===null||logger===void 0||logger.warn(STORAGE_TYPE_VALIDATION_WARNING(context,type));}if(entries){Object.entries(entries).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),entryKey=_ref2[0],entryOpts=_ref2[1];var entryType=entryOpts===null||entryOpts===void 0?void 0:entryOpts.type;if(isDefined(entryType)&&!isValidStorageType(entryType)){logger===null||logger===void 0||logger.warn(UNSUPPORTED_STORAGE_ENTRY_TYPE_WARNING(context,entryKey,entryType));}});}};/**
|
|
3388
|
+
* Parses a URL without the URL constructor, which is unavailable on legacy JS engines
|
|
3389
|
+
* until the polyfills load.
|
|
3390
|
+
*/var legacyParseUrl=function legacyParseUrl(url){var anchor=document.createElement('a');anchor.href=url;return {host:anchor.host,protocol:anchor.protocol};};var getTopDomain=function getTopDomain(url){// Extract the host and protocol. This runs before the polyfills load,
|
|
3391
|
+
// thus new URL cannot be used unconditionally
|
|
3392
|
+
var _ref3=typeof globalThis.URL!=='function'?legacyParseUrl(url):new URL(url),host=_ref3.host,protocol=_ref3.protocol;// Split the host into parts
|
|
3364
3393
|
var parts=host.split('.');var topDomain;// Handle different cases, especially for co.uk or similar TLDs
|
|
3365
3394
|
if(parts.length>2){// Join the last two parts for the top-level domain
|
|
3366
|
-
topDomain=
|
|
3367
|
-
topDomain=host;}return {topDomain:topDomain,protocol:protocol};};var
|
|
3395
|
+
topDomain=parts.slice(-2).join('.');}else {// If only two parts or less, return as it is
|
|
3396
|
+
topDomain=host;}return {topDomain:topDomain,protocol:protocol};};var ABSOLUTE_URL_REGEX=/^https?:\/\//i;var getDataServiceUrl=function getDataServiceUrl(endpoint,useExactDomain,topHost){// An absolute URL carries its own host, so it is used as the final request URL as it is
|
|
3397
|
+
if(ABSOLUTE_URL_REGEX.test(endpoint)){return endpoint;}// An unknown top host (ex: IP address hosts) leaves the current origin as the only usable host
|
|
3398
|
+
var url=useExactDomain||!topHost?window.location.origin:"".concat(window.location.protocol,"//").concat(topHost);var formattedEndpoint=endpoint.startsWith('/')?endpoint.substring(1):endpoint;return "".concat(url,"/").concat(formattedEndpoint);};/**
|
|
3399
|
+
* Determines whether a host falls under a cookie domain, as the browser does when
|
|
3400
|
+
* it decides which cookies to send to a request.
|
|
3401
|
+
*/var isDomainMatch=function isDomainMatch(hostname,cookieDomain){return hostname===cookieDomain||hostname.endsWith(".".concat(cookieDomain));};/**
|
|
3402
|
+
* Determines whether the data service can set cookies that the current webpage is able to read.
|
|
3403
|
+
* A host outside the webpage's domain can only set cookies for its own domain.
|
|
3404
|
+
*/var isWebpageDataServiceHost=function isWebpageDataServiceHost(dataServiceHostname,webpageTopDomain,hostOnlyCookies){// Host-only cookies can be read back only by the exact host that set them
|
|
3405
|
+
if(hostOnlyCookies||!webpageTopDomain){return dataServiceHostname===globalThis.location.hostname;}return isDomainMatch(dataServiceHostname,webpageTopDomain);};var isWebpageTopLevelDomain=function isWebpageTopLevelDomain(providedDomain){var _getTopDomain=getTopDomain(window.location.href),topDomain=_getTopDomain.topDomain;return topDomain===providedDomain;};
|
|
3368
3406
|
|
|
3369
3407
|
/**
|
|
3370
3408
|
* Removes trailing slash from url
|
|
3371
3409
|
* @param url
|
|
3372
3410
|
* @returns url
|
|
3373
|
-
*/var _removeTrailingSlashes=function removeTrailingSlashes(url){return url!==null&&url!==void 0&&url.endsWith('/')?_removeTrailingSlashes(url.substring(0,url.length-1)):url;};var getDomain=function getDomain(url){try{var urlObj=new URL(url);return urlObj.host;}catch(error){return null;}};/**
|
|
3411
|
+
*/var _removeTrailingSlashes=function removeTrailingSlashes(url){return url!==null&&url!==void 0&&url.endsWith('/')?_removeTrailingSlashes(url.substring(0,url.length-1)):url;};var getDomain=function getDomain(url){try{var urlObj=new URL(url);return urlObj.host;}catch(error){return null;}};var getHostname=function getHostname(url){try{var urlObj=new URL(url);return urlObj.hostname;}catch(error){return null;}};/**
|
|
3374
3412
|
* Get the referring domain from the referrer URL
|
|
3375
3413
|
* @param referrer Page referrer
|
|
3376
3414
|
* @returns Page referring domain
|
|
@@ -3430,20 +3468,39 @@ var _iterator=_createForOfIteratorHelper(scripts),_step;try{for(_iterator.s();!(
|
|
|
3430
3468
|
* Updates the reporting state variables from the source config data
|
|
3431
3469
|
* @param res Source config
|
|
3432
3470
|
* @param logger Logger instance
|
|
3433
|
-
*/var updateReportingState=function updateReportingState(res){state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);}
|
|
3471
|
+
*/var updateReportingState=function updateReportingState(res){state.reporting.isErrorReportingEnabled.value=isErrorReportingEnabled(res.source.config)&&!isSDKRunningInChromeExtension();state.reporting.isMetricsReportingEnabled.value=isMetricsReportingEnabled(res.source.config);};/**
|
|
3472
|
+
* Resolves the webpage's browser-verified cookie domain, along with the same domain carrying
|
|
3473
|
+
* the current port so that a derived data service URL still points at the webpage's own server.
|
|
3474
|
+
* Note: the storage module probes the same cookie levels again while building the default
|
|
3475
|
+
* cookie options; both belong in the refactor noted below.
|
|
3476
|
+
*/var getWebpageTopDomain=function getWebpageTopDomain(){var topDomain=domain(globalThis.location.href);var port=globalThis.location.port;return {topDomain:topDomain,topHost:topDomain&&port?"".concat(topDomain,":").concat(port):topDomain};};/**
|
|
3477
|
+
* Determines whether the cookies the data service would set are ones the webpage can read
|
|
3478
|
+
* back, and reports the reason when they are not.
|
|
3479
|
+
*/var isServerSideCookiesUsable=function isServerSideCookiesUsable(dataServiceHostname,providedCookieDomain,webpage,sameDomainCookiesOnly,logger){// The data service sets the cookies, so it has to be a host whose cookies the webpage
|
|
3480
|
+
// can read back. In the same domain cookies mode they are host-only, hence the exact host
|
|
3481
|
+
if(!isWebpageDataServiceHost(dataServiceHostname,webpage.topDomain,sameDomainCookiesOnly)){logger.error(SERVER_SIDE_COOKIE_DATA_SERVICE_HOST_ERROR(CONFIG_MANAGER,dataServiceHostname,webpage.hostname));return false;}// The cookie domain is dropped altogether in the same domain cookies mode
|
|
3482
|
+
if(sameDomainCookiesOnly||!isDefined(providedCookieDomain)){return true;}/**
|
|
3483
|
+
* A provided cookie domain only works if the data service is able to set it and the webpage
|
|
3484
|
+
* falls under it, ex: cookie domain 'random.com', or a sibling subdomain of the webpage
|
|
3485
|
+
*/// Hostnames reach us already lowercased, a configured cookie domain does not
|
|
3486
|
+
var cookieDomain=removeLeadingPeriod(providedCookieDomain).toLowerCase();/**
|
|
3487
|
+
* The cookie domain also has to sit at or below the browser-verified domain of the webpage.
|
|
3488
|
+
* Anything above it is a public suffix, ex: 'co.uk', which the browser refuses to scope
|
|
3489
|
+
* cookies to however well it matches as a string suffix.
|
|
3490
|
+
*/if(!isDomainMatch(dataServiceHostname,cookieDomain)||!isDomainMatch(webpage.hostname,cookieDomain)||webpage.topDomain&&!isDomainMatch(cookieDomain,webpage.topDomain)){logger.error(SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_ERROR(CONFIG_MANAGER,providedCookieDomain,webpage.hostname));return false;}return true;};var getServerSideCookiesStateData=function getServerSideCookiesStateData(logger){var _state$loadOptions$va=state.loadOptions.value,useServerSideCookies=_state$loadOptions$va.useServerSideCookies,dataServiceEndpoint=_state$loadOptions$va.dataServiceEndpoint,storageOptsFromLoad=_state$loadOptions$va.storage,setCookieDomain=_state$loadOptions$va.setCookieDomain,sameDomainCookiesOnly=_state$loadOptions$va.sameDomainCookiesOnly;var cookieOptions=storageOptsFromLoad===null||storageOptsFromLoad===void 0?void 0:storageOptsFromLoad.cookie;var sscEnabled=false;var finalDataServiceUrl;if(useServerSideCookies){var _cookieOptions$domain;sscEnabled=useServerSideCookies;var providedCookieDomain=(_cookieOptions$domain=cookieOptions.domain)!==null&&_cookieOptions$domain!==void 0?_cookieOptions$domain:setCookieDomain;/**
|
|
3434
3491
|
* Based on the following conditions, we decide whether to use the exact domain or not to determine the data service URL:
|
|
3435
3492
|
* 1. If the cookie domain is provided and it is not a top-level domain, then use the exact domain
|
|
3436
3493
|
* 2. If the sameDomainCookiesOnly flag is set to true, then use the exact domain
|
|
3437
|
-
*/var useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;var dataServiceUrl=getDataServiceUrl(dataServiceEndpoint!==null&&dataServiceEndpoint!==void 0?dataServiceEndpoint:DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain)
|
|
3494
|
+
*/var useExactDomain=isDefined(providedCookieDomain)&&!isWebpageTopLevelDomain(removeLeadingPeriod(providedCookieDomain))||sameDomainCookiesOnly;var webpageHostname=globalThis.location.hostname;var _getWebpageTopDomain=getWebpageTopDomain(),webpageTopDomain=_getWebpageTopDomain.topDomain,webpageTopHost=_getWebpageTopDomain.topHost;var dataServiceUrl=getDataServiceUrl(dataServiceEndpoint!==null&&dataServiceEndpoint!==void 0?dataServiceEndpoint:DEFAULT_DATA_SERVICE_ENDPOINT,useExactDomain,webpageTopHost);// The hostname is unavailable on legacy JS engines without the URL polyfill,
|
|
3495
|
+
// in which case the data service host cannot be verified
|
|
3496
|
+
var dataServiceHostname=getHostname(dataServiceUrl);if(isValidURL(dataServiceUrl)&&dataServiceHostname){finalDataServiceUrl=_removeTrailingSlashes(dataServiceUrl);sscEnabled=isServerSideCookiesUsable(dataServiceHostname,providedCookieDomain,{hostname:webpageHostname,topDomain:webpageTopDomain},sameDomainCookiesOnly,logger);// If the current hostname is different from the data service hostname, then it is a
|
|
3497
|
+
// cross-site request. Cookies are not isolated by port, hence it plays no part here.
|
|
3438
3498
|
// For server-side cookies to work, we need to set the SameSite=None and Secure attributes
|
|
3439
3499
|
// One round of cookie options manipulation is taking place here
|
|
3440
3500
|
// Based on these(setCookieDomain/storage.cookie or sameDomainCookiesOnly) two load-options, final cookie options are set in the storage module
|
|
3441
3501
|
// TODO: Refactor the cookie options manipulation logic in one place
|
|
3442
|
-
if(
|
|
3443
|
-
|
|
3444
|
-
* and the data service host is different from the provided cookie domain, then we disable server-side cookies
|
|
3445
|
-
* ex: provided cookie domain: 'random.com', data service host: 'sub.example.com'
|
|
3446
|
-
*/if(!sameDomainCookiesOnly&&useExactDomain&&dataServiceHost!==removeLeadingPeriod(providedCookieDomain)){sscEnabled=false;logger.warn(SERVER_SIDE_COOKIE_FEATURE_OVERRIDE_WARNING(CONFIG_MANAGER,providedCookieDomain,dataServiceHost));}}else {sscEnabled=false;}}return {sscEnabled:sscEnabled,cookieOptions:cookieOptions,finalDataServiceUrl:finalDataServiceUrl};};var updateStorageStateFromLoadOptions=function updateStorageStateFromLoadOptions(logger){var _storageOptsFromLoad$;var storageOptsFromLoad=state.loadOptions.value.storage;// Only reported here. The applicable default depends on the consent phase, so the unsupported
|
|
3502
|
+
if(sscEnabled&&webpageHostname!==dataServiceHostname){cookieOptions=_objectSpread2(_objectSpread2({},cookieOptions),{},{samesite:'None',secure:true});}}else {// A malformed dataServiceEndpoint reaches here, ex: a typo in an absolute URL
|
|
3503
|
+
logger.error(DATA_SERVER_URL_INVALID_ERROR(CONFIG_MANAGER,dataServiceUrl));sscEnabled=false;}}return {sscEnabled:sscEnabled,cookieOptions:cookieOptions,finalDataServiceUrl:finalDataServiceUrl};};var updateStorageStateFromLoadOptions=function updateStorageStateFromLoadOptions(logger){var _storageOptsFromLoad$;var storageOptsFromLoad=state.loadOptions.value.storage;// Only reported here. The applicable default depends on the consent phase, so the unsupported
|
|
3447
3504
|
// values are resolved in the store manager.
|
|
3448
3505
|
validateStorageOptions(storageOptsFromLoad,CONFIG_MANAGER,logger);var storageEncryptionVersion=storageOptsFromLoad===null||storageOptsFromLoad===void 0||(_storageOptsFromLoad$=storageOptsFromLoad.encryption)===null||_storageOptsFromLoad$===void 0?void 0:_storageOptsFromLoad$.version;var encryptionPluginName=storageEncryptionVersion&&StorageEncryptionVersionsToPluginNameMap[storageEncryptionVersion];if(!isUndefined(storageEncryptionVersion)&&isUndefined(encryptionPluginName)){// set the default encryption plugin
|
|
3449
3506
|
logger.warn(UNSUPPORTED_STORAGE_ENCRYPTION_VERSION_WARNING(CONFIG_MANAGER,storageEncryptionVersion,StorageEncryptionVersionsToPluginNameMap,DEFAULT_STORAGE_ENCRYPTION_VERSION));storageEncryptionVersion=DEFAULT_STORAGE_ENCRYPTION_VERSION;}else if(isUndefined(storageEncryptionVersion)){storageEncryptionVersion=DEFAULT_STORAGE_ENCRYPTION_VERSION;}// Allow migration only if the configured encryption version is the default encryption version
|